Android ListView first element different color -


i'm working on project having 2 list views used select different regions , cities. thing is, have option "all region" , "all cities" , i'd have these 2 of different color (in case, main app color)

i've tried things such getitematposition on listview nothing working.. here's code related listview:

mlistview = (listview) findviewbyid(r.id.list); arraylist<string> regions = getintent().getextras().getstringarraylist("regions_selection"); mlistview.setonitemclicklistener(new adapterview.onitemclicklistener() { @override     public void onitemclick(adapterview<?> parent, view view, int position, long id) {         string regionid;         if (position == 0) {             regionid = "";         } else {             regionid = optionsmanager.getinstance().getoptions().getregion(position - 1).getid();         }         searchinformations.getinstance().setregionid(regionid);         startactivity(new intent(phoneregionlistactivity.this, phoneclublistactivity.class));     } }); mlistview.setadapter(new arrayadapter<>(this, r.layout.list_item, regions)); 

before setting adapter (starting kitkat anytime) can add header views wrapped automatically.

view = getlayoutinflater().inflate(r.layout.list_item, mlistview, false); // setup view regions/cities mlistview.addheaderview(all); mlistview.setadapter(new arrayadapter<>(this, r.layout.list_item, regions)); 

Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -