How do I set the background color of the home screen app widget programmatically?
Remember widget is remoteView. You have very limited resource to updates UI of widget and not directly.
You can try :
remoteViews.setInt(viewId, "setBackgroundColor", Color.BLACK);
I never used it but i guess it may be the way.
I guess you need to change color dynamically.
You can change color of ImageView image in "RemoteViews" by doing this:
remoteviews.setInt(viewid, "setColorFilter", color);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With