Skip to content Skip to sidebar Skip to footer

Android- Loading Contacts With Viewholder And Asynctask- Thumbnail Issue

I am creating a custom contact app.. I use a ArrayAdapter with ViewHolder design pattern for optimization...Since it took a lot of time to load the thumbnail pics, I use AsyncTask

Solution 1:

Figured it out...Now its working..Soln given by Simon Meyer in Comments is correct..I need to initialize the imageView to a bitmap in getView() before I could call Async Task..Here is the change in code

holder.position = position;

holder.imageView.setImageURI( Uri.parse("android.resource://com.vishnu.demotingprototype/drawable/ic_contact_picture"));

new LoadContactImage(getContext(),holder,position,contactId.get(position)).execute();

Solution 2:

i think your customclass is not find out the context of lader image class. Declare context in yorr activity first.all is going well rather than this....Its works fine

Post a Comment for "Android- Loading Contacts With Viewholder And Asynctask- Thumbnail Issue"