I am working on an android 2.2 app. When clicking a button I would like to display a list with checkboxes with all the contact persons from the list. After checking the persons from the list I want to display the phone numbers of the persons from the list. I don’t know how to do that.
I don’t know how to display in a listview with checkboxes all the contact persons from a list. Need some help.
This is my code for the ocntact list:
public void onActivityResult(int requestCode, int resultCode, Intent intent)
{
if (requestCode == PICK_CONTACT)
{
Cursor cursor = managedQuery(intent.getData(), null, null, null, null);
cursor.moveToNext();
String contactId = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts._ID));
String name = cursor.getString(cursor.getColumnIndexOrThrow(ContactsContract.Contacts.DISPLAY_NAME));
Toast.makeText(this, "Contect LIST = "+name, Toast.LENGTH_LONG).show();
}
}//onActivityResult
}
How to put all the contact name and phone numbers in a listview with checkboxes and than when ok is pressed to save all the checked persons in a list or a vector?
this link must help you
http://www.vogella.de/articles/AndroidListView/article.html
UPDATE1:
after:
write: