Matisse-Kotlin icon indicating copy to clipboard operation
Matisse-Kotlin copied to clipboard

Android 11无法拍照

Open Carlos2927 opened this issue 4 years ago • 2 comments

测试设备:Google Pixel 3A 原因:MediaStoreCompat.dispatchCaptureIntent()中captureIntent.resolveActivity(context.packageManager) != null为false

Carlos2927 avatar Sep 09 '20 12:09 Carlos2927

manifest中添加

<!-- 1. 软件可见性适配方案 -->
<!-- the new restrictions on "package visibility" introduced in Android 11. intent.resolveActivity returns null.-->
<queries>
    <!-- Browser -->
    <intent>
        <action android:name="android.intent.action.VIEW" />
        <data android:scheme="http" />
    </intent>
    <!-- Camera -->
    <intent>
        <action android:name="android.media.action.IMAGE_CAPTURE" />
    </intent>
    <!-- Gallery -->
    <intent>
        <action android:name="android.intent.action.GET_CONTENT" />
    </intent>
</queries>

PontonMao avatar Aug 03 '21 09:08 PontonMao

遇到同样的问题,太感谢了

pinguoooo avatar Mar 29 '22 01:03 pinguoooo