OnActivityResult returns null data for video capture in Nexus 4 with v4.3

OnActivityResult returns zero data for video capture (video camera option). The functionality works fine on all devices except the Nexus 4 - v4.3 device when we use the code below.

Intent intent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE);
currentActivity.startActivityForResult(intent,  Constants.REQ_CODE_PICTURE_SNAP_RECORDER);

If we use the code below, the functionality works fine on all devices except HTC One S v4.1.1.

 Intent intent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE);
 intent.putExtra(MediaStore.EXTRA_OUTPUT,fileUri);
 currentActivity.startActivityForResult(intent,  Constants.REQ_CODE_PICTURE_SNAP_RECORDER);

The main problem is that the URI path is different from the following:

Getting File Location as:
    FileNotFoundException:
    /storage/emulated/0/DCIM/ImagesFolder/VID_20140612_012146.3gp

Saving File Location is:
    mnt/sdcard/DCIM/ImagesFolder/VID_20140605_020203.3gp

Can you suggest someone suggest me to solve this problem as common to all mobile devices.

+4
source share

Source: https://habr.com/ru/post/1544302/


All Articles