I want to show thumbnail before playing video.My video is in /res/raw folder.I am trying following method to get Real path of my video file.But getContentResolver().query(contentUri, proj , null, null, null)
this returning null without any exception.
@SuppressWarnings("deprecation")
public String getRealPathFromURI(Uri contentUri) {
String[] proj = { MediaStore.Images.Media.DATA };
Cursor cursor = getContentResolver().query(contentUri, proj , null, null, null);
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
cursor.moveToFirst();
return cursor.getString(column_index);
}
Am I missing something? Any permission in Manifest?