1

I'm developing a video player and I would like to know how I get the URI from a video I launch from an intent I have already configured in the manifest.

So far, all I have is this:

    @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    videoURI = data.getDataString();
    vv.setVideoURI(Uri.parse(videoURI));          

}

This sends me to a launch error so it must be wrong. I've already taken a look at this: Get filename and path from URI from mediastore but I don't know if it is what I am looking for and I don't understand how to use the answer. If someone could clarify it for me, send me in the direction or help me in any way it would be great. Thanks

Community
  • 1
  • 1
Timmo
  • 2,266
  • 4
  • 34
  • 54

1 Answers1

0
Uri vid = data.getData();
videoPath = getRealPathFromURI(vid)
Laurel
  • 5,965
  • 14
  • 31
  • 57
Ramesh sambu
  • 3,577
  • 2
  • 24
  • 39