从主屏幕小部件Android 4+打开QuickContactBadge

时间:2013-02-02 16:04:07

标签: android-widget android-contacts

我正在尝试从主屏幕小部件显示快速联系人徽章,该小部件以网格布局显示最喜欢的联系人图片。我仔细阅读了提示here,但我仍然无法理解。

当我点击某个联系人时,我总会收到以下错误:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.gridwidget/com.example.gridwidget.ContactBadge}: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.android.contacts.action.QUICK_CONTACT

尽管我正在调用'ContactsContract.QuickContact.showQuickContact();'来自一项活动。

此意图导致问题:com.android.contacts.action.QUICK_CONTACT

我尝试将其添加到我的清单文件中但未成功:

<activity
        android:name="com.example.gridwidget.ContactBadge"
        android:label="@string/title_activity_contact_badge"
        android:theme="@android:style/Theme.NoDisplay" >

         <intent-filter>
            <action android:name="com.android.contacts.action.QUICK_CONTACT" />
            <action android:name="com.example.gridwidget.BADGE_ACTION" />
        </intent-filter>
</activity>

有什么建议吗?由于我正在展示一个集合,因此我使用了here

所述的RemoteViewsService模式

由于

1 个答案:

答案 0 :(得分:0)

我发现了问题。我传递给ContactsContract.QuickContact.showQuickContact()的URI格式错误。

现在正常运作