D ducphu Active Member Licensed User Longtime User Nov 30, 2015 #1 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 Code: Copy rv.SetImage("IV1",LoadBitmapSample(File.DirRootExternal,"bitmap1.png",20dip,20dip)) AND Code: Copy 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?
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 Code: Copy rv.SetImage("IV1",LoadBitmapSample(File.DirRootExternal,"bitmap1.png",20dip,20dip)) AND Code: Copy 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?
Erel B4X founder Staff member Licensed User Longtime User Nov 30, 2015 #2 You should always store the current state and then restore it when the service is created. Upvote 0
D ducphu Active Member Licensed User Longtime User Nov 30, 2015 #3 Just to clarify, you mean I should store the uri, and call it in service_create ? Upvote 0
D ducphu Active Member Licensed User Longtime User Dec 1, 2015 #5 OK. Thanks, it seems to work. Anw I run into an issue with Seturi method. I think I will post it here https://www.b4x.com/android/forum/threads/remoteviews-seturi.60854/ Last edited: Dec 1, 2015 Upvote 0
OK. Thanks, it seems to work. Anw I run into an issue with Seturi method. I think I will post it here https://www.b4x.com/android/forum/threads/remoteviews-seturi.60854/