我有一个SyncAdapter,联系人同步正常。只有我想要一个漂亮的徽章添加到联系人应用程序的QuickContactBadge中。我该如何使用它?
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?
推荐答案我找到了解决方案。 您基本上可以在清单中告诉您哪个活动可以处理合并的联系人。进行合并时,您已经选择了一种哑剧类型,请在中为您选择的活动使用这种哑剧类型:
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>然后,在活动开始时,您可以通过以下方式获得联系:光标cur = getContentResolver ().query(getIntent()。getData(),null,null,null,null);
Then when the activity starts you can get the contact by doing: Cursor cur = getContentResolver().query(getIntent().getData(), null, null, null, null);
更多推荐
使用SyncAdapter将徽章和意图添加到QuickContactBadge
发布评论