Android Question Imageview on widget loses its image

ducphu

Active Member
Licensed User
Longtime User
Hi all,

My widget has around 50 imageviews (size ~20x20dip) Basically in during the widget update, I will need to do some calculations to generate the bitmap for each imageview, then save those bitmaps in DirRootExternal. Then I will assign the bitmaps to the imageviews. I tried to use

B4X:
rv.SetImage("IV1",LoadBitmapSample(File.DirRootExternal,"bitmap1.png",20dip,20dip))

AND

B4X:
SetUri("widget", "IV1", "file://" & File.Combine(File.DirRootExternal, "bitmap1.png"))

The bitmaps loaded fine. But on testing, I use the phone to do some heavy task, like taking photo or playing some heavy games, when I press Home button to return to homescreen, all the imageviews on my widget lose their bitmap. What should I do to fix this?
 
Top