开发者

Problems with a widget in Android

At the moment, my android widget runs a PendingIntent when you click it. The problem is that if the activity is already running in the background, the wi开发者_如何转开发dget runs it a second time. Is there any way to make the widget open the currently running version as opposed to a completely new one?


You can mark your Activity as having a launchMode of singleTop or singleTask which should let you use the onNewIntent callback to receive the intent. See http://developer.android.com/guide/topics/manifest/activity-element.html#lmode for more detail.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜