开发者

Android: how to get notified when a widget is tapped

I would like to get a notification when the user taps/clicks on a widget?

Is there something similar开发者_JAVA百科 to onClick()?


You must use AppWidgetProvider and register listeners there. Since in Widgets all view are created via RemoteViews you must use methods on them - e.g. setOnClickPendingIntent().

Here is a small example: http://developer.android.com/guide/topics/appwidgets/index.html#AppWidgetProvider

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜