I read this answer from @CommonsWare.
This happens when I open the devices default camera application. But it doesn't happen on my Samsung J7 Pro running 8.1.0
I open the camera like this:
Uri videoUri = FileProvider.getUriForFile(this, getApplicationContext().getPackageName() + ".provider", filePlusName);
Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
intent.setPackage(defaultCameraPackageName);
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.putExtra(MediaStore.EXTRA_OUTPUT, videoUri);
startActivityForResult(intent, VIDEO_REQUEST_CODE);//Crash pointing to this
I'm not sure if doing it like this will solve the issue (I doubt it)?
Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
intent.setPackage(defaultCameraPackageName);
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.putExtra(MediaStore.EXTRA_OUTPUT, FileProvider.getUriForFile(MainActivity.this, getApplicationContext().getPackageName() + ".provider", filePlusName));
startActivityForResult(intent, VIDEO_REQUEST_CODE);//Crash pointing to this
I have no idea why this is happening,
Any advise would greatly be appreciated .