android - Sorting a GridView with column headers -
android - Sorting a GridView with column headers -
i have gridview contains 4 columns populated next code:
public void showgrid() { dbhelper = new databasehelper(this); seek { cursor = dbhelper.getallaccounts(); startmanagingcursor(a); string[] = new string[]{databasehelper.colname, databasehelper.colamount, databasehelper.colperiodclass, databasehelper.colstatclass}; int[] = new int[]{r.id.colname, r.id.colamount, r.id.colperiod, r.id.colstat}; simplecursoradapter saa = new simplecursoradapter(this, r.layout.accrow, a, from, to); grid.setadapter(saa); } grab (exception ex) { alertdialog.builder b = new alertdialog.builder(this); b.setmessage(ex.tostring()); b.show(); } }
grid works fine , all, issues are
how column headers clickable.how sort items based on specific column field clicked.
for illustration arrange items in view name/amount in ascending/descending order or grouping items similar values in period ( has 5 specific values ) or status ( has 3 specific values )
i've looked around far i've seen asp , c# related stuff , nil android. can point me in right direction or show me how?
android sorting gridview simplecursoradapter
Comments
Post a Comment