【问题标题】:Does SyncAdapter is really required to Add a Quick Contact badge?SyncAdapter 是否真的需要添加快速联系人徽章?
【发布时间】:2012-05-15 17:09:45
【问题描述】:

我希望我的申请出现在快速联系徽章中。 我使用了 SyncAdapter(如 this 很棒的教程中所述)。

但由于我希望此徽章在我的所有联系人中都可见并且只需打开我的应用程序,因此为每个现有联系人创建我自己的帐户和联系人并保持此帐户更新似乎是一种非常笨拙的方法.

还有其他方法吗?

【问题讨论】:

    标签: android android-layout android-intent android-contacts


    【解决方案1】:

    不,它没有。

    关键是使用正确的 mime 类型。 为了让我的应用在所有联系人的快速联系人徽章中可见,我在清单文件中使用了以下设置:

            <activity
            android:name=".activities.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
    
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="vnd.android.cursor.item/name" />
            </intent-filter>
        </activity>
    

    仅此而已 - 没有同步提供程序或任何其他服务或活动。

    如果有人知道如何使应用程序徽章仅适用于具有电话号码的联系人,而不是所有联系人,我将不胜感激。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-25
      • 1970-01-01
      • 2015-06-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多