0

I'm trying to send the user to the native contacts application so that they can edit the contact in there, it's working fine in V3.0+ But in a device with 2.3.3 it's giving me an exception, can someone explain me what might be happening?

The code is the following:

if(contactLookupKey != null) {
        Intent intent = new Intent(Intent.ACTION_EDIT);
        Uri lookupUri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_VCARD_URI, contactLookupKey);
        Uri res = ContactsContract.Contacts.lookupContact(getContentResolver(), lookupUri);
        intent.setData(res);

        this.isEditing = true;
        startActivity(intent);
}

And i'm getting the following Exception:

01-31 15:51:50.544: E/AndroidRuntime(27867): java.lang.IllegalArgumentException: Invalid column _id
01-31 15:51:50.544: E/AndroidRuntime(27867):    at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:144)
01-31 15:51:50.544: E/AndroidRuntime(27867):    at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:114)
01-31 15:51:50.544: E/AndroidRuntime(27867):    at android.content.ContentProviderProxy.bulkQueryInternal(ContentProviderNative.java:330)
01-31 15:51:50.544: E/AndroidRuntime(27867):    at android.content.ContentProviderProxy.query(ContentProviderNative.java:366)
01-31 15:51:50.544: E/AndroidRuntime(27867):    at android.content.ContentResolver.query(ContentResolver.java:268)

In the manifest i have:

<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />


<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.contactive"
    android:installLocation="auto"
    android:versionCode="17"
    android:versionName="0.8.5" >

<uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="16" />

Thanks a lot!

5
  • Can you include the relevant parts of your manifest? Jan 31, 2013 at 20:57
  • Also, can you give information about the device? At least the model, carrier is also nice. Jan 31, 2013 at 21:00
  • Device: Sony Ericsson r800x
    – albertosh
    Jan 31, 2013 at 21:04
  • Please edit your question to include manifest. The key parts are the use-stk-version and similar portions... Jan 31, 2013 at 21:05
  • Carrier: Verizon Wireless
    – albertosh
    Jan 31, 2013 at 21:09

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.