KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am trying to write an app that store data for the user for each contacts he chooses. I want to add to each user a custom provider (like facebook does) that on press will open my app and allow the user to review the stored data. I have created a custom provider following this guide: http://www.c99.org/2010/01/23/writing-an-android-sync-provider-part-2/ but the custom provider does not appear on my contact list, I have tried to change my MIME_TYPE to vnd.com.google.cursor.item/contact_user_defined_field that didnt help either (when using third party app it showed my provider but without my icon) my contact definition is this: <ContactsSource xmlns:android="http://schemas.android.com/apk/res/android"> <ContactsDataKind android:icon="@drawable/ic_launcher" android:mimeType="vnd.android.cursor.item/vnd.MyPackageName.profile" android:summaryColumn="data2" android:detailColumn="data3" android:detailSocialSummary="true" /> </ContactsSource> and my relevant code is this: String MIME_TYPE "vnd.android.cursor.item/vnd.MyPackageName.profile"; ArrayList<ContentProviderOperation> ops = new ArrayList<ContentProviderOperation>(); int rawContactInsertIndex =ops.size();//(int)Contact_RAW_ID; ops.add(ContentProviderOperation.newInsert(RawContacts.CONTENT_URI) .withValue(RawContacts.ACCOUNT_TYPE, null) .withValue(RawContacts.ACCOUNT_NAME,null ) .build()); ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI) .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, 0) .withValue(Data.MIMETYPE,Phone.CONTENT_ITEM_TYPE) .withValue(Phone.NUMBER, "9X-XXXXXXXXX") .build()); ops.add(ContentProviderOperation.newInsert(Data.CONTENT_URI) .withValueBackReference(Data.RAW_CONTACT_I
Tags (comma-separated)
Save Edits
Cancel