Avoiding FAILED BINDER TRANSACTION error when updating lots of widget bitmaps

Ash McConnell picture Ash McConnell · Aug 1, 2011 · Viewed 18.8k times · Source

I am coming across an error when I am updating my RemoteViews in my AppWidget.

.. !!! FAILED BINDER TRANSACTION !!!

This is caused because all the changes to the RemoteViews are serialised (e.g. setInt and setImageViewBitmap ). The bitmaps are also serialised into an internal bundle. Unfortunately this bundle has a very small size limit.

I cannot use setImageResource as I am hoping to allow the user to download skins for the widget.

Can anyone recommend a workaround for this problem? I am already using a "new" RemoteViews object for each instance of the widget, but a single instance contains too many updates.

Thanks!

Answer

Ash McConnell picture Ash McConnell · Aug 2, 2011

The best workaround I found was to use setImageURI on the ImageView objects using

remoteViews.setUri(R.id.myImageView, "setImageURI", "file://blahblahblah.png");

Here is the full discussion from Android Developers group