9

This is a weird one. I am seeing this crash report on some devices:

android.content.ActivityNotFoundException:
   No Activity found to handle Intent {
     act=android.intent.action.PICK dat=content://com.android.contacts/contacts }

The intent that generates this error is:

Intent intent = new Intent(Intent.ACTION_PICK, People.CONTENT_URI); // pre-Eclair

Or:

Intent intent = new Intent(Intent.ACTION_PICK, Contacts.CONTENT_URI); // post-Eclair

The device is simply reported as "Droid" but I don't know the OS version.

sehugg
  • 3,615
  • 5
  • 43
  • 60
  • These answers seem relevant: http://stackoverflow.com/questions/3547118/accessing-the-phonebook-on-galaxy-s-crashes-the-app, http://stackoverflow.com/questions/866769/how-to-call-android-contacts-list, and http://stackoverflow.com/questions/2792166/edit-contact-code-worked-in-1-6-but-doesnt-work-on-droid-2-1 – Oleg Vaskevich Aug 19 '12 at 03:31
  • Please go through this link it may help you http://developer.android.com/guide/topics/providers/contacts-provider.html – SAURABH_12 Jul 16 '13 at 11:52

1 Answers1

1

To get a contact I use the following code:

Intent intent = new Intent ( Intent.ACTION_GET_CONTENT );
intent.setType ( ContactsContract.Contacts.CONTENT_ITEM_TYPE );
startActivityForResult ( intent, 1 );
Andrea Carron
  • 1,001
  • 13
  • 22