I get media path of image in nativescript
my code:
var logoPath = argIntent.getParcelableExtra(Intent_1.EXTRA_STREAM);
but I get this path:
content://media/external/images/media/152
How to get absolute path including the file name from this path??
In Nativescript/Javascript implementation please! if there is some kind of code ..
--
I need something like this, but in javascript code:
public static String getRealPathFromURI_API19(Context context, Uri uri){
String filePath = "";
String wholeID = DocumentsContract.getDocumentId(uri);
// Split at colon, use second item in the array
String id = wholeID.split(":")[1];
String[] column = { MediaStore.Images.Media.DATA };
// where id is equal to
String sel = MediaStore.Images.Media._ID + "=?";
Cursor cursor = context.getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
column, sel, new String[]{ id }, null);
int columnIndex = cursor.getColumnIndex(column[0]);
if (cursor.moveToFirst()) {
filePath = cursor.getString(columnIndex);
}
cursor.close();
return filePath;
}
How I can rewrite it!?