Devv Active Member Licensed User Longtime User Sep 1, 2016 #1 hi i had made a program that loads about 200 items in a custom listview in item 189 it crashes and give out of memory error i had already used loadsample B4X: imv.Bitmap = LoadBitmapSample(File.DirInternalCache,AsyncDownloader.FileName,640,360) my device is galaxy s6 edge, which is very powerfull, why did it crashed in less than 200 images ? is there is a way to load the images only when i scroll to them ?
hi i had made a program that loads about 200 items in a custom listview in item 189 it crashes and give out of memory error i had already used loadsample B4X: imv.Bitmap = LoadBitmapSample(File.DirInternalCache,AsyncDownloader.FileName,640,360) my device is galaxy s6 edge, which is very powerfull, why did it crashed in less than 200 images ? is there is a way to load the images only when i scroll to them ?
Erel B4X founder Staff member Licensed User Longtime User Sep 2, 2016 #2 (It should be 640dip, 360dip) You can ask the OS to give you more memory by adding this line to the manifest editor: B4X: SetApplicationAttribute(android:largeHeap, "true") A better solution is to only load the images that are currently visible. Add more images when the user scrolls the list and remove non-visible images. Upvote 0
(It should be 640dip, 360dip) You can ask the OS to give you more memory by adding this line to the manifest editor: B4X: SetApplicationAttribute(android:largeHeap, "true") A better solution is to only load the images that are currently visible. Add more images when the user scrolls the list and remove non-visible images.
Devv Active Member Licensed User Longtime User Sep 2, 2016 #3 Erel said: (It should be 640dip, 360dip) You can ask the OS to give you more memory by adding this line to the manifest editor: B4X: SetApplicationAttribute(android:largeHeap, "true") A better solution is to only load the images that are currently visible. Add more images when the user scrolls the list and remove non-visible images. Click to expand... thanks for fast replay 1- what will b4a consider the size if i did not sepecify the dip or %x ? 2- how can i do the better solution ? Upvote 0
Erel said: (It should be 640dip, 360dip) You can ask the OS to give you more memory by adding this line to the manifest editor: B4X: SetApplicationAttribute(android:largeHeap, "true") A better solution is to only load the images that are currently visible. Add more images when the user scrolls the list and remove non-visible images. Click to expand... thanks for fast replay 1- what will b4a consider the size if i did not sepecify the dip or %x ? 2- how can i do the better solution ?
Devv Active Member Licensed User Longtime User Sep 3, 2016 #4 Hi Erel how can i "only load the images that are currently visible" ? Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Sep 4, 2016 #5 CustomListView doesn't implement such a feature. You will need to implement it yourself. You can use ULV which does support it. Check this thread for another option: https://www.b4x.com/android/forum/t...ds-more-when-scroll-tot-bottom.35761/#content Upvote 0
CustomListView doesn't implement such a feature. You will need to implement it yourself. You can use ULV which does support it. Check this thread for another option: https://www.b4x.com/android/forum/t...ds-more-when-scroll-tot-bottom.35761/#content