Hi,
I am using VideoRecordApp to record a video and it crashes on Android > 7 (> api 24)
Code I am using:
Error:
What's the solution? I also use AudioRecordApp and it works well.
Kind regards.
I am using VideoRecordApp to record a video and it crashes on Android > 7 (> api 24)
Code I am using:
B4X:
'Provider is a Fileprovider that has been configured
'Also my manifest has FileProvider snippet correctly
videoRecorder.Record2(Starter.Provider.SharedFolder, SendReport.EvidenceFilename, 15)
Error:
B4X:
** Activity (sendreportactivity) Resume **
Error occurred on line: 298 (SendReportActivity)
android.os.FileUriExposedException: file:///storage/emulated/0/Android/data/com.ohiritech.app/files/Evidence 1.mp4 exposed beyond app through ClipData.Item.getUri()
at android.os.StrictMode.onFileUriExposed(StrictMode.java:1799)
at android.net.Uri.checkFileUriExposed(Uri.java:2346)
at android.content.ClipData.prepareToLeaveProcess(ClipData.java:832)
at android.content.Intent.prepareToLeaveProcess(Intent.java:8909)
at android.content.Intent.prepareToLeaveProcess(Intent.java:8894)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1517)
at android.app.Activity.startActivityForResult(Activity.java:4224)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:767)
at android.app.Activity.startActivityForResult(Activity.java:4183)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:754)
at anywheresoftware.b4a.BA.startActivityForResult(BA.java:542)
at anywheresoftware.b4a.audio.AudioRecordApp$VideoRecordApp.Record2(AudioRecordApp.java:263)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:777)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:354)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA$2.run(BA.java:370)
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:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
What's the solution? I also use AudioRecordApp and it works well.
Kind regards.