i am updating one bitmap in widget (the whole widget is only one ImageView) like this
remoteViews.setImageViewBitmap(...)
and in some rare situations (it happend 3 times in 6 months of every day use) i get "!!! FAILED BINDER TRANSACTION !!!". then, only phone reboot solves this problem. uninstaling and installing again, does not help, only reboot.
i checked the icon's size and it is only 56 kilobytes, so it fits within the IPC memory limit. when i remove setImageViewBitmap(...) the widget works again, but the bitmap is not updated. so the problem is in the bitmap itself. what could cause this binder transaction fail when the bitmal is this small?
for now, i solved this by saving the icon to /data and i am sending only the URI to widget. but i would like to know, where can be a problem, when i am clearly not hitting the IPC memory limit?
EDIT: i forget to mention, it happend on android 2.3.5 and also 2.3.7
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.
You can solve it by scaling down the image size this way:
Choose newHeight to be small enough (~100 for every square it should take on the screen) and use it for your widget, and your problem will be solved :)
It seems we can not parse more then 1 mb in an intent.
In case you were reusing your remoteViews variable: each time you update bitmap on the same
ImageView
, this is recorded as separate remote views action. There is no way to clear or deduplicate list of actions, associated withRemoteViews
. The only thing you can do in this case is just recreate remoteVies instead of reusing it infinitely