开发者

android EXTRA_APPWIDGET_IDS issues

There is a problem about andro开发者_C百科id . I think the developers would know "AppWidgetManager.EXTRA_APPWIDGET_IDS", it is the problem, when I got "AppWidgetManager.EXTRA_APPWIDGET_IDS" like "intent.getExtras().getIntArray(AppWidgetManager.EXTRA_APPWIDGET_IDS)", the result show that "AppWidgetManager.EXTRA_APPWIDGET_IDS" is NULL.

Who can tell me why?


If you want your question to get understood and have people to spend time answering you should invest a bit more time in formatting your question and providing more detail!

That aside:

in onReceive() try:

int appWidgetId = intent.getExtras().getInt(AppWidgetManager.EXTRA_APPWIDGET_ID,
AppWidgetManager.INVALID_APPWIDGET_ID);

in onUpdate() you get the list of ids already as the parameter!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜