1

I want to display the phone's contact log directly inside my application on a button click, in order to select a contact and its number. Can anybody help me with this?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Aswathy P Krishnan
  • 11,728
  • 7
  • 27
  • 45

1 Answers1

2

I got the answer. :)

String myData = "content://contacts/people/";
Intent myActivity2 = newIntent(Intent.ACTION_VIEW, Uri.parse( myData) );
startActivity(myActivity2); 

or we can use

        Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
        intent.setType(ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE);
        startActivityForResult(intent, 2); 
Aswathy P Krishnan
  • 11,728
  • 7
  • 27
  • 45