i have list view , custom adapter it. works perfect want add non clickable label, if condition true. if condition true should display normal list item. , problem don't know how can add label , afterwards normal item.
i beginner , tried lot didn't it.
@override public view getview(int position, view convertview, viewgroup parent) { layoutinflater inflater = (layoutinflater) context .getsystemservice(context.layout_inflater_service); view rowview; if (position == 3){ rowview = inflater.inflate(r.layout.event_date, parent, false); textview date = (textview) rowview.findviewbyid(r.id.event_date); // set text } else { rowview = inflater.inflate(r.layout.events_list, parent, false); textview title = (textview) rowview.findviewbyid(r.id.event_title); // set text } return rowview; }
baseadapter has method called isenabled() can override. can use assign if specific position clickable or not.
@override public boolean isenabled(int position) { if (position == 3) { return false; } else { return true; } }
you need declare not items enabled using areallitemsenabled().
@override public boolean areallitemsenabled() { return false; }
Comments
Post a Comment