I was following these links to get the contacts in my application
How to call Android contacts list?
http://www.higherpass.com/Android/Tutorials/Working-Wit
Simply, have a contact data object, and whenever you select any item in list, set value of that contact into this field.
in
AdapterView.onItemClickListener()
{
public void onItemClick(AdapterView list, View view, int position, long id)
{
Contact contact=listContacts.get(position);
selectedContact=contact;//If Done Button on List
//if activity is to be finished on selection
{
Intent intent=new Intent();
intent.putExtra(KEY_NAME, contact.Name);
....
setResult(RESULT_OK, intent);
finish();
}
}
}