android - Glitches in getView -


i showing list of contacts .all except device has 1620 contacts list scrolling slow , hangs.

please me out.

i tried using check in getview method convertview!=null alwayz inflate same view many times. in advance..

my code getview method:-

if(convertview==null)         {   view= minflater.inflate(r.layout.facebookfriend, null);                 textview name=(textview)view.findviewbyid(r.id.textview1);                 imageview image=(imageview)view.findviewbyid(r.id.imageview1);             name.settext(mlist.get(position).get("name"));                  string id=mlist.get(position).get("contactid");                 log.e("id",""+id);                 checkbox chkbox= (checkbox)view.findviewbyid(r.id.checkbox1);                 chkbox.setoncheckedchangelistener(new oncheckedchangelistener() {                     @override                     public void oncheckedchanged(                             compoundbutton buttonview, boolean ischecked) {                         isselected.set(position, ischecked);                     }                 });                                  string photoid=mlist.get(position).get("photoid");             log.e("photoid",""+photoid);                 if(mlist.get(position).get("photoid")!=null){                     log.e("photoid",""+"photoid");                     image.setimagebitmap(loadcontactphoto(id, mlist.get(position).get("photoid")));             }         }     } 

you can make listview load data dynamically per requirement, see so post, should use viewholder make more efficient, see this.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -