Android的RemoteView
类提供了方法setOnClickPendingIntent
而不是setOnClickListener
。这是什么原因?在这种情况下使用PendingIntent
有什么好处?为什么Android RemoteView类仅提供setOnClickPendingIntent
1
A
回答
0
IIRC
远程视图没有在您的应用程序的进程中运行,因此必须使用IPC告诉你的应用程序的东西被点击。这是异步的,因此它是“待处理”点击,而不是即时点击。这个名字反映了一种微妙的行为差异。
#setOnClickPendingIntent(int, android.app.PendingIntent)
VS
* IIRC *远程查看是不是在你的应用程序的进程中运行,因此必须使用IPC来告诉你的应用程序的东西被点击。这是异步的,因此它是“待处理”点击,而不是即时点击。这个名字反映了一种微妙的行为差异。 – Blundell 2014-10-27 12:01:58
@Blundell让你的评论成为一个答案。 – 2014-11-03 20:31:29