I asked this previous question and have edited it to suit my code for a Video Player running from an intent
videoURI = getIntent().getData();
vv.setVideoURI(videoURI);
but this gives me a blank string when I test it with setText()
How do I get this to work so I can get the full path for the launched video? EG. /storage/extSdCard/Videos/Video.mp4
My Code:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Uri uri = data.getData();
String[] filePathColumn = { MediaStore.Video.Media.DATA };
Cursor cursor = getContentResolver().query(uri,
filePathColumn, null, null, null);
cursor.moveToFirst();
int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
path = cursor.getString(columnIndex);
cursor.close();
}