Quantcast
Channel: Active questions tagged listview - Stack Overflow
Viewing all articles
Browse latest Browse all 611

Listview in alphabetical order

$
0
0

I have a listview that gets facebook friends, and i would like to sort the names in alphabetical order, but im not very sure how to go on and do this.

Here is the code:

@Override        public void onComplete(List<Profile> friends) {            // populate list            List<String> values = new ArrayList<String>();            for (Profile profile : friends) {                //profile.getInstalled();                values.add(profile.getName());            }            ArrayAdapter<String> friendsListAdapter = new ArrayAdapter<String>(getApplicationContext(), R.layout.list_items2, values);            mFriendsList.setAdapter(friendsListAdapter);        }    };

I have looked around for solutions but didn't find for arraydapter.


Viewing all articles
Browse latest Browse all 611

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>