android - Creating a scrollable list of items that can be ordered according to different criteria? -


ii create scrollable list of items can sorted according different criteria can chosen user action bar; thinking of button says:"sort by...". working on android app.

i developing tourist guide, or rather, making app out of paper tourist guide have written, have list of monuments through user can browse.

it great if user sort items of list in alphabetical order, or according rating of monuments or on basis of tag indicating type (historical building, museum, etc.).

would possible display under name of each item, sort of subtitle, series of dots or stars indicating above-mentioned rating?

at last not least, possible, when monuments sorted name or rating, automatically group them tag? in song player apps, when choose artist, of his/her songs displayed grouped album. in case grouping tag represent zone in city of monuments.

despite experience in publishing, newbie in android (followed few courses) , api docs made me agoraphobic coding. know asking don't demand detailed explanation few suggestions solution, bunch of helpful guidelines , names of specific api docs array lists , sorting methods should at.

thanks help.

firstly, need have custom java object particular item

for example:

public class customitem{  private string name; private int rating; private string tag;  // getters , setters   } 

then can create listview input consisting of list of type customitem. here listview tutorial: http://www.vogella.com/tutorials/androidlistview/article.html

you can have somethibng spinner, in can add sort criteria. when user selects 1 sort criteria, can sort input list listview , refresh listview doing: listview.getadapter().notifydatasetchanged();

hope helps.


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -