[Bug] Setting images for widget with many imageviews

corwin42

Expert
Licensed User
Longtime User
[Solved] Setting images for widget with many imageviews

I have a homescreen widget with some imageviews. Updating the images does not work reliably.

This took me some time to find out what's the problem so I could create a test project. If you run the test project (at least on my device) the images are not displayed in the widget. In the unfiltered log I can see the message "!!! FAILED BINDER TRANSACTION !!!"

If I update just one image it works. If I call rv.UpdateWidget after setting the image it works better but still some images won't display. When the problem occurs even the Panel1_Click event does not fire anymore.

Any ideas?
 

Attachments

  • WidgetBug.zip
    56.8 KB · Views: 226
Last edited:

corwin42

Expert
Licensed User
Longtime User
The strange thing is that it worked some time ago. I have reworked my weather app completely and now I wanted to reactivate the widget and got the problem.
I used the old layout file and the old code. The only thing I changed was the data structure with the weather data and that I now use caching for the images so that not every bitmap is loaded again for each image.

...

Ah, and I changed the image files. They now are 256x256 pixel in size instead of 128x128. I will try to use LoadBitmapSample instead with the size I need.

Thanks for the info. With this I can hopefully fix the issue in my app.
 

corwin42

Expert
Licensed User
Longtime User
Ok, LoadBitmapSample fixed the problem completely. I thought dealing with small icon like files wouldn't be a problem in my app. I was wrong.
 
Top