android - Changing Widget Layout Programmatically -


Assume that I have two layouts for one widget: default layout for layout 1 and Layout 2 widget is 1, But I allow the user to choose which widget they want. So, if the user changes into layout 2, then how do I change the layout in layout 2?

There is not a set contentweep method for widgets for verbs.

Thanks

When you are creating your remote view, would choose. In my widget code:

  public static remote view buildupdate (reference references, string actions) {see remote video; Shared references prefs = context.getSharedPreferences (PREFS_NAME, 0); String typeface = prefix .get string ("typeface", "without"); Int layout Id = R. Lateite.widet_san; If ("monospace" .exe (typeface)) {layoutId = R.layout.widget_mono; } And if ("serif" .cl (typeface)) {layoutId = R.layout.widget_serif; } UpdateViews = New Remote Power (context.getPackageName (), Layout ID); // Actually works here / again, finally, return to our Remote Wife App, WitmanMaster.Just Instance (Context). UpddAppWidget (new component name (context, fuzzy widget), updateviews); }  

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

jquery - SimpleModal Confirm fails to submit form -