java - Android: Changing LinearLayout in a widget -
i have annoying problem:
in widget, change background code. noticed on google doc can change background of imageview:
remoteviews.setimageviewresource(r.id.my_iv, r.drawable.my_bg);
ok, easy, want change linear layout.. read remoteview id can change bitmap, int, bool, string, etc... not drawable. guess cannot use:
remoteviews.setbitmap(r.id.my_ll,"setbackgrounddrawable",bitmapfactory.decoderesource(context.getresources(), r.drawablemy_bg));
i totally disapointed , tried last idea:
views.setint(r.id.my_ll,"setbackgroundresource",r.drawable.my_bg);
but logcat told me:
android.widget.remoteviews$actionexception:view: android.widget.linearlayout can't use method remoteviews: setbackgroundresource(int)
i totally lost , don't know do...
i appreciate help.
thank lot!
you cannot modify background way, due limitations in remoteviews
api.
what can choose different layout -- 1 background want -- when create remoteviews
instance particular update.
Comments
Post a Comment