Android Question ContentChooser error

hanyelmehy

Active Member
Licensed User
Longtime User
i use ContentChooser Example from this link https://www.b4x.com/android/forum/threads/contentchooser-example-select-image-at-phone.109022/,when test on android 5 ,i get this error
B4X:
java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/images/media/2703 from pid=408, uid=10462 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()
    at android.os.Parcel.readException(Parcel.java:1540)
    at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:185)
    at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:148)
    at android.content.ContentProviderProxy.openTypedAssetFile(ContentProviderNative.java:689)
    at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1088)
    at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:927)
    at android.content.ContentResolver.openInputStream(ContentResolver.java:652)
    at anywheresoftware.b4a.objects.streams.File.OpenInput(File.java:211)
    at anywheresoftware.b4a.objects.drawable.CanvasWrapper$BitmapWrapper.Initialize(CanvasWrapper.java:516)
    at anywheresoftware.b4a.keywords.Common.LoadBitmap(Common.java:1343)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
    at anywheresoftware.b4a.phone.Phone$ContentChooser$1.ResultArrived(Phone.java:865)
    at anywheresoftware.b4a.BA$4.run(BA.java:568)
    at anywheresoftware.b4a.BA.setActivityPaused(BA.java:442)
    at com.web2apk.convert.paywork1$ResumeMessage.run(paywork1.java:306)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:145)
    at android.app.ActivityThread.main(ActivityThread.java:5942)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)
** Activity (paywork1) Resume **
as i understand ContentChooser not need READ_EXTERNAL_STORAGE permission. ??
note :when add READ_EXTERNAL_STORAGE permission it work fine on android 5
 
Top