联系人自定义字段未显示在HTC Sense中

时间:2012-02-18 23:57:58

标签: android contactscontract htcsense

我写了一个自定义的syncadapter,它还为rawcontacts添加了一个自定义字段。究竟是如何使用last.fm-App在SampleSyncAdapterthis example中完成的。它在模拟器上工作正常。

xml文件,它声明了我的自定义字段:

<ContactsSource xmlns:android="http://schemas.android.com/apk/res/android">
    <ContactsDataKind
        android:mimeType="vnd.com.google.cursor.item/vnd.alien.mimetype"
        android:icon="@drawable/icon"
        android:summaryColumn="data2"
        android:detailColumn="data3"
        android:detailSocialSummary="true" />
</ContactsSource>

将自定义字段添加到contactscontract-provider的数据表中的代码:

mContentUri = Data.CONTENT_URI.buildUpon().appendQueryParameter(ContactsContract.CALLER_IS_SYNCADAPTER, "true").build();
    Builder mID = ContentProviderOperation.newInsert(mContentUri)
            .withValue(Data.RAW_CONTACT_ID, getRawContactId())
            .withValue(Data.MIMETYPE, "vnd.com.google.cursor.item/vnd.alien.mimetype")
            .withValue(Data.DATA1, mContactInformations.get("mID"))
            .withValue(Data.DATA2, mContext.getString(R.string.profile_text))
            .withValue(Data.DATA3, mContext.getString(R.string.profile_id)+" "+mContactInformations.get("mID"));

但是当我在安装了HTC Sense的HTC Desire上运行它们时,我再也看不到这个自定义字段了?!?有没有人遇到过同样的问题?

非常感谢任何让我的自定义字段可见的提示!

干杯Ali3n

2 个答案:

答案 0 :(得分:1)

默认联系人查看器不显示自定义字段。

有些第三方应用确实会显示自定义字段,而免费提供(但支持广告)is here

答案 1 :(得分:0)

不幸的是,我没有找到真正的解决方案。但有两件事可以减少这个问题:

这个问题只出现在我原来的HTC Desire上。在我的姐妹HTC Sensation上,自定义字段按预期出现(在第一次尝试oO时很好地从HTC失败)

更好的是,通过此自定义字段启动的意图也会显示在QuickContactBadge中,即使在我的HTC Desires Sense上,本机HTC Contacts-App也会使用它。因此,用户可以通过旧Senses版本上的QuickContactBadge调用我的活动,在新版本中,他也可以使用自定义字段。