Android12+ 创建文件、文件夹

AndroidManifest.xml

增加权限:

    
    
    
    
    

Application 代码增加:

        android:requestLegacyExternalStorage="true"
        android:usesCleartextTraffic="true"

Java代码

动态申请权限增加:

            Manifest.permission.MANAGE_EXTERNAL_STORAGE,
            Manifest.permission.READ_MEDIA_IMAGES,
            Manifest.permission.READ_MEDIA_AUDIO,
            Manifest.permission.READ_MEDIA_VIDEO,

你可能感兴趣的:(android,android)