【发布时间】:2023-04-09 20:26:01
【问题描述】:
Android 的RemoteView 类提供了setOnClickPendingIntent 方法,而不是setOnClickListener。这是什么原因?在这种情况下使用PendingIntent 有什么好处?
【问题讨论】:
-
iirc 远程视图未在您的应用程序进程中运行,因此它必须使用 IPC 告诉您的应用程序单击了某些内容。这是异步的,因此它是“待定”点击,而不是即时点击。该名称反映了细微的行为差异。
-
@Blundell 将您的评论变成答案。
标签: android android-pendingintent remoteview android-remoteview