I run into problem while using content uri and FileProvider on Android API 19 (Kitkat). Here's code that I use to open camera on device and record a video:
File file = new File(pathname);
Uri fileUri = FileProvider.getUriForFile(this, AUTHORITY_STRING, file);
Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);
startActivityForResult(intent, requestCode);
I've tested this code on API's 23-24 and it works just fine, but on API 19 camera closes with RESULT_CANCELED after I starting to take video in camera app. The same thing happening when I'm trying to take a picture with ACTION_IMAGE_CAPTURE action. I've tried to change FileProvider.getUriForFile() with Uri.fromFile(). This works perfectly on Kitkat, but I can't use it on Android 7. Why is Camera on Adnroid Kitkat doesn't want to work with content uri?