1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
public void recupererNumerosContacts()
{
String ordreaffichage = ContactsContract.Contacts.DISPLAY_NAME + " COLLATE LOCALIZED ASC";
Cursor cursor =managedQuery(Phones.CONTENT_URI, null,null, null, ordreaffichage);
String nom=String.valueOf(Phones.NAME);
String num=String.valueOf(Phones.NUMBER);
String parametres[]={nom,num};
listecontacts = new int[] {android.R.id.text1,android.R.id.text2};
LvContacts= (ListView) findViewById(R.id.listView01);
LvContacts.setAdapter(new SimpleCursorAdapter(getApplicationContext(),
android.R.layout.simple_list_item_1,cursor,parametres,listecontacts));
LvContacts.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
} |
Partager