问题
I have a SyncAdapter and contact syncing works fine. Only i want a nice badge added to the QuickContactBadge in the contact application. How can i get this to work?
回答1:
I found the solution. You basically tell, in your manifest, which activity can handle contacts which are merged. When doing the merging you have chosen a mime type, use this mime type in an for an activity you choose:
<intent-filter android:icon="@drawable/hyves">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/vnd.hyves.profile" />
</intent-filter>
Then when the activity starts you can get the contact by doing: Cursor cur = getContentResolver().query(getIntent().getData(), null, null, null, null);
来源:https://stackoverflow.com/questions/4806987/add-badge-and-intent-to-quickcontactbadge-with-syncadapter