Skip to content Skip to sidebar Skip to footer

Why Isn't My Edit Contact Working?

I'm displaying a list of Contacts, and have a context menu to Edit Contact by calling an intent. On some contacts it works fine, but on others the Edit Contact activity is blank. A

Solution 1:

Try this:

Uriuri= ContactsContract.CommonDataKinds.Phone.CONTENT_URI;
Cursorcursor=this.getContentResolver().query(uri, null, null, null, ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME + " ASC");
longidContact= cursor.getLong(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.CONTACT_ID));

then

Intenti=newIntent(Intent.ACTION_EDIT);
UricontactUri= ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI, idContact); 
i.setData(contactUri);

Post a Comment for "Why Isn't My Edit Contact Working?"