gpt4 book ai didi

android - ActivityNotFoundException 试图加载联系人 ContentProvider?

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:44:13 24 4
gpt4 key购买 nike

这很奇怪。我在某些设备上看到了这个崩溃报告:

android.content.ActivityNotFoundException:
No Activity found to handle Intent {
act=android.intent.action.PICK dat=content://com.android.contacts/contacts }

产生这个错误的 Intent 是:

Intent intent = new Intent(Intent.ACTION_PICK, People.CONTENT_URI); // pre-Eclair

或者:

Intent intent = new Intent(Intent.ACTION_PICK, Contacts.CONTENT_URI); // post-Eclair

该设备被简单地报告为“Droid”,但我不知道操作系统版本。

最佳答案

要获取联系人,我使用以下代码:

Intent intent = new Intent ( Intent.ACTION_GET_CONTENT );
intent.setType ( ContactsContract.Contacts.CONTENT_ITEM_TYPE );
startActivityForResult ( intent, 1 );

关于android - ActivityNotFoundException 试图加载联系人 ContentProvider?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3701966/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com