The following 3 methods (from RemoteViews
class) can be used to update an image on a Home Screen widget, on Android:
setImageViewResource (int viewId, int srcId)
setImageViewUri (int viewId, Uri uri)
setImageViewBitmap (int viewId, Bitmap bitmap)
But after lot of research, I found that setImageViewUri()
is the best one to use, to avoid the error "**!!! FAILED BINDER TRANSACTION !!!**"
that can happen when updating the widget. But why is this the case? I couldn't find any proper reason or JavaDoc documentation.