Add video path to file provider paths

581 Views Asked by At

How can I add video captured path in File Provider? I am getting Content Uri form FileProvider. The video I caputure using default Camera App returns File Uri on Android 6.0, for which content resolver returns null. I want to read video size from the content resolver cursor.getColumnIndex(OpenableColumns.SIZE). How can I handle this issue?

1

There are 1 best solutions below

5
On BEST ANSWER

If the scheme of the Uri is file, call new File(uri.getPath()).length() to get the length of the file. This should work if you have read access to the file.