【问题标题】:PICK_CONTACT in xiaomi phone id column not found找不到小米手机 id 列中的 PICK_CONTACT
【发布时间】:2020-05-27 06:16:32
【问题描述】:
        Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);
        startActivityForResult(intent, PICK_CONTACT);

致命异常:java.lang.RuntimeException

传递结果失败 ResultInfo{who=null, request=131073, result=-1, data=Intent { dat=content://com.mi.android.globalFileexplorer.myprovider/root_files/storage/3B44-17E3/DCIM /Camera/FB_IMG_1553740630380.jpg flg=0x1 }} 到活动 java.lang.IllegalArgumentException:列“_id”不存在。可用列:[_display_name, _size]

在其他设备上工作

【问题讨论】:

    标签: android


    【解决方案1】:

    试试startActivityForResult(newIntent(Intent.ACTION_PICK,ContactsContract.CommonDataKinds.Phone.CONTENT_URI), REQUEST_PICK_CONTACT);

    【讨论】:

    • 适用于所有设备还是仅适用于小米手机?
    • ContactsContract.CommonDataKinds.Phone.CONTENT_URI 无法在诺基亚设备中获取用户的手机号码。只得到名字和姓氏
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-09
    相关资源
    最近更新 更多