tags:

views:

242

answers:

1

I have an appwidget which has got a ImageButton.I can update ImageButton image but i can't update backgroundcolor with using setInt() method;because imagebutton setBackgroundColor is not annoated with RemotableViewMethod.class.What can i do else?

+1  A: 

You can try using a different layout in your RemoteViews constructor that has the right background color. You create a RemoteViews object on every update, and you tell that RemoteViews object what layout to use. From my testing, if you inflate something different than before, that will replace what the app widget presently uses. The various RemoteViews setters are for things that you cannot readily handle via layouts (e.g., dynamic text for a TextView).

CommonsWare