开发者

Saving Simplistic Android Widget Across Restarts

I have a issue that I have been struggling with for some time and its becoming quite frustrating...

I have an app that a user can modify the background image of a widget in a configure activity. Once they select what 开发者_开发问答image they want I save a SharedPreferences file with the widgetsID and the value for the image... however in the onEnabled of the WidgetProvider I do not know the widget ID, so I can not do a look up of which image to use... Since there can be multiple instances of this widget I do not know which id goes with which onEnabled...

any suggestions?


Can be accomplished simply by:

    int[] allids = AppWidgetManager .getInstance(context) .
getAppWidgetIds(new ComponentName(context, AwarenessWidget.class));

I can get all the IDs of my app and call onupdate and update each ones views based upon the saved preferences

I can elaborate more if anyone needs...

Baffels me no one was able to figure that one out and help me! seems very straight forward now!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜