Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display Contacts in alphabetic order in Listview [closed]

I have a custom List view and i need to display the contacts in Alphabetical order can u provide the sample code how can i achieve this?

like image 645
Anil Kumar Avatar asked Sep 06 '11 08:09

Anil Kumar


1 Answers

you can get contacts in alphabatical order like this:

Cursor cursor = getContentResolver.query(Phone.CONTENT_URI, null, null, null, Phone.DISPLAY_NAME + " ASC");

refer these links for more cearity:

How to call Android contacts list?

How to get contacts from native phonebook in android

How to obtain all details of a contact in Android

How to get the first name and last name from Android contacts?

How to import contacts from phonebook to our application

Android contacts extraction

How to get all android contacts but without those which are on SIM

For list you can refer this tutorial:

http://www.vogella.de/articles/AndroidListView/article.html

like image 64
Vineet Shukla Avatar answered Oct 04 '22 08:10

Vineet Shukla