expandablelistview - Android Expandable List groups textView random replace -



expandablelistview - Android Expandable List groups textView random replace -

friends,

i having problem expandable list - first time list groups drawn correctly, (respective textviews texts replaced, e.g. 3 of 9) when of groups clicked textviews of grouping (random) replaced instead of beeing untouched mm.

what should done prevent this?

here adapter class:

public class interestlistadapter extends baseexpandablelistadapter { ... @override public view getgroupview(int groupposition, boolean isexpanded, view convertview, viewgroup parent) { if (convertview == null) { convertview = layoutinflater.from(_context).inflate(r.layout.activity_interest_list_group, parent, false); } seek { hashmap<string, string> involvement = this._listdataheader.get(string.valueof(groupposition)); string interestid = interest.get("interest_id"); string interestname = interest.get("interest_name"); jsonobject intereststree = new jsonobject(library.loadstring(_context, "userintereststree")); textview listgroupname = (textview) convertview.findviewbyid(r.id.interest_list_group_name); listgroupname.settext(interestname); if (this._listdatachild.containskey(string.valueof(interestid))) { string subinterestall = string.valueof(this._listdatachild.get(string.valueof(interestid)).size()); if (intereststree.has(interestid)) { string subinterestchecked = intereststree.getstring(interestid); textview subinteresttext = (textview) convertview.findviewbyid(r.id.interest_list_group_selected); subinteresttext.settext(subinterestchecked + " of " + subinterestall); } } } grab (exception e) { log.e("error", log.getstacktracestring(e)); } homecoming convertview; } }

i'm rather sure, have problems memory management. when expand list cells become hidden screen. after then, when scroll it, have regenerated. android os, save memory, doesn't generate them scratch, instead of uses same memory regions, used hidden cells.

it looks subinteresttext problematic field. it's beingness set if both these ifs true:

if (this._listdatachild.containskey(string.valueof(interestid)))

and

if (intereststree.has(interestid))

if 1 of them false, subinteresttext variable won't set. so, result, value usedfrom hidden field - in case - 2 of 2.

to prepare - setup values of cell in getgroupview method.

android expandablelistview expandablelistadapter

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -