我已添加
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
,但它显示
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.selectmultipleimages_demo/com.selectmultipleimages_demo.CustomGallery_Activity}: java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=5290, uid=10149 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission() exception
答案 0 :(得分:1)
随后是Android版API 23,即从Marshmallow开始,您需要获得运行时权限才能访问用户的机密数据。此处明确说明了运行时权限:Requesting Permissions at Run Time
此外,此Answer将帮助您实现运行时权限,以便写入外部存储。