Open Mfdsix opened 4 years ago
when i try to make new File object from returned Uri, i got error No Such File or Directory. How can i fix this ?
I use this function to convert uri to real path, while contentURI is the uri passed from bsimagepicker
private String getRealPathFromURI(Uri contentURI) { String result=contentURI.getPath(); Cursor cursor = getActivity().getContentResolver().query(contentURI, null, null, null, null); if (cursor == null) { // Source is Dropbox or other similar local file path result = contentURI.getPath(); } else { if (cursor.moveToFirst()) { result = cursor.getString(cursor.getColumnIndex(MediaStore.Images.ImageColumns.DATA)); } cursor.close(); } return result; }
when i try to make new File object from returned Uri, i got error No Such File or Directory. How can i fix this ?