Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android 4.0.3 ACTION_INSERT_OR_EDIT intent not working

When i try to use this Intent like so....

Intent i = new Intent(Intent.ACTION_INSERT_OR_EDIT);
i.setType(ContactsContract.Contacts.CONTENT_ITEM_TYPE);
startActivityForResult(i,INSERT_CONTACT);

it loads the contact list then after selecting or creating a contact I do not return back to my app. i have checked the logs and nothing stands out. Is there a new intent action in ICS?

Thanks

like image 261
Maurycy Avatar asked Dec 18 '11 22:12

Maurycy


1 Answers

Your missing this line:

intent.putExtra(ContactsContract.Intents.Insert.NAME, "Larry Page");

Valid "fields": http://developer.android.com/reference/android/provider/ContactsContract.Intents.Insert.html

like image 122
Codeversed Avatar answered Oct 27 '22 00:10

Codeversed