android - how to make group by in listview -
i have custom list view custom array adapter.. fill list view array data base...
the problems = how can show list view distinct in database / group by... want listview, not data base because reason...
here snipcode
public void setlistview(){ int jumlahdata = a_bonrokok_main.count; int jumlahdatadetail = a_bonrokok_main.countdetail; log.d("jumlah data : ", ""+jumlahdata); log.d("jumlah data detail : ", ""+jumlahdatadetail); if(jumlahdata > 0){ tabitemlist = new arraylist<bonrokok_salesplandetail_model>(); final bonrokok_tabitem_adapter adapter = new bonrokok_tabitem_adapter(getactivity(), tabitemlist); (int = 0; < jumlahdatadetail; i++) { string namarokok = a_bonrokok_main.namarokok[i]; string jumlah = a_bonrokok_main.jumlah[i]; string satuan = a_bonrokok_main.satuan[i]; tabitemlist.add(new bonrokok_salesplandetail_model(namarokok, integer.parseint(jumlah), satuan)); log.d("nama rokok : ", namarokok); log.d("jumlah : ", jumlah); log.d("satuan : " , satuan); } listcontent.setadapter(adapter); } else { tabitemlist = new arraylist<bonrokok_salesplandetail_model>(); final bonrokok_tabitem_adapter adapter = new bonrokok_tabitem_adapter(getactivity(), tabitemlist); listcontent.setadapter(adapter); } }
with code data this
cigar 1 | 10 cigar 2 | 10 cigar 1 | 10 cigar 2 | 10
what want this
cigar 1 | 20 cigar 2 | 20
Comments
Post a Comment