I have created a database of objects. Each of these objects contains two strings and two bitmaps. When I do a getAllContacts() call to my database, the loading takes quite a while. For me its not a problem, but for the end-users, this would be annoying. When I load an object I set this options to my bitmaps saying:
BitmapFactory.Options options=new BitmapFactory.Options();
options.inSampleSize = 8;
Which will shrink the Bitmaps to 1/8 of the original height and width. But still, it takes around 10-15 seconds to load 50 records and fill this into a ListView. Is there any way I can check if the object I try to load is in the memory, also called paging? Or maybe I can load the Bitmaps, when the users presses one of the items in the ListView?
Thanks in advance!
The solution:
So, finally I found a solution to my problem. Instead of getting all of the
Bitmapswhen I do agetAllContact()call, the bitmap’s is loaded when the user presses a row in theListViewThis is whats done in thesetOnClickListenermethod in CustomAdapter for myListViewAnd the
getFinger(...)method:I hope this example will give other people a pinpoint in the right direction.