wufoo wufoo - 2 months ago 15
Android Question

how to change Android TextView Drawable in appwidget

I have an Android AppWidget which uses a Drawable on the left side of the textview. I'd like to update that Drawable with a different image at certain times but don't see a way to do that using RemoveViews. Is this possible?

Answer

If you mean using drawableLeft on a RemoteView, I don't think there is a way.

You would need to modify your layout and make the image a separate object, for example use an ImageView and place it next to the TextView.

Then call...

remoteView.setImageViewBitmap(R.id.imageViewId, myBitmap);
Comments