Add badge and intent to QuickContactBadge with SyncAdapter

筅森魡賤 提交于 2019-12-13 02:15:03

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!