android - how to refresh listview -


i want enable , disable linearlayout. inside listview item. called notifydatasetchanged. getview not called , layout not getting visible. how can refresh view inside onclick in getview?

    @override     public view getview(int position, view convertview, viewgroup parent) {         // todo auto-generated method stub         if (convertview == null){             convertview = inflater.inflate(r.layout.qna_list_item, parent, false);         }         final imageview openbtn= (imageview)convertview.findviewbyid(r.id.qna_list_item_open_btn);         final linearlayout replyview = (linearlayout) convertview.findviewbyid(r.id.qna_list_item_reply);         openbtn.setonclicklistener(new onclicklistener() {              @override             public void onclick(view v) {                 // todo auto-generated method stub                 replyview.setvisibility(view.visible);                 openbtn.setimageresource(r.drawable.list_btn_up);                 notifydatasetchanged();               }         });         return convertview;     }  } 

you need update adapter data/model not item views, can call notifydatasetchanged(); refresh listview.


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -