I want my application to pick a video from the gallery. It uses following code to get the path.
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
i.setType("video/*");
startActivityForResult(i,2);
and then
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// TODO Auto-generated method stub
if(resultCode==RESULT_OK){
str = data.getData().getPath();
//this.go();
this.ko();
}
}
str stores the path. For a test run its value is /external/video/media/10 but it should be something like /sdcard/DCIM/a.mp4 to load the video using MediaMetaDataRetriever. How to do that ?
In your case, (As I understand your question)
Use, this function to get Real path from the Uri..
Function: