Hello, I use this "sub" to show the image that the user selects from a list.
It works for several years, however now it shows this error and I do not know what it is.
B4X:
Sub ImgShow( cFile As String )
If cFile="" Then Return
'
Dim inttFile As Intent
Dim cDir As String = cLocalPath
'
inttFile.Initialize(inttFile.ACTION_VIEW, "file://" & File.Combine(cDir,cFile))
inttFile.SetType("image/*")
'
StartActivity( inttFile )
End Sub
I am sorry to bother again with my problems, but I still consider myself quite new and I get stuck with many doubts.acinfocomercial_mostrar (java line: 857)
android.os.FileUriExposedException: file:///storage/emulated/0/Android/data/conkex.preventa/files/infocomercial/100Euros.jpeg exposed beyond app through Intent.getData()
at android.os.StrictMode.onFileUriExposed(StrictMode.java:1799)
at android.net.Uri.checkFileUriExposed(Uri.java:2346)
at android.content.Intent.prepareToLeaveProcess(Intent.java:8970)
at android.content.Intent.prepareToLeaveProcess(Intent.java:8931)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1517)
at android.app.Activity.startActivityForResult(Activity.java:4225)
at android.app.Activity.startActivityForResult(Activity.java:4183)
at android.app.Activity.startActivity(Activity.java:4522)
at android.app.Activity.startActivity(Activity.java:4490)
at anywheresoftware.b4a.keywords.Common.StartActivity(Common.java:848)
at conkex.preventa.acinfocomercial._mostrar(acinfocomercial.java:857)
at conkex.preventa.acinfocomercial._lvfiles_itemclick(acinfocomercial.java:732)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:191)
at anywheresoftware.b4a.BA$1.run(BA.java:330)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:969)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:859)
android.os.FileUriExposedException: file:///storage/emulated/0/Android/data/conkex.preventa/files/infocomercial/100Euros.jpeg exposed beyond app through Intent.getData()
** Activity (acinfocomercial) Pause, UserClosed = true **
** Activity (main) Resume **