使用SyncAdapter将徽章和意图添加到QuickContactBadge

编程入门 行业动态 更新时间:2024-10-22 14:04:04
本文介绍了使用SyncAdapter将徽章和意图添加到QuickContactBadge的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个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

本文发布于:2023-11-27 08:13:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1637231.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:徽章   意图   SyncAdapter   QuickContactBadge

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!