Aman,

Do this to let user pick a video

Intent i = new Intent(Intent.ACTION_PICK);
i.setType("video/*");
startActivityForResult(i, PICK_VIDEO);

and in onActivityResult look for the request code 'PICK_VIDEO' and
pass along the URI of the selected video to another activity this way:

Uri data = intent.getData();

if (data != null) {

Intent i = new Intent(this, YourVideoPlayer.class);
i.setData(data);
startActivity(i);

}

Hope that helps

Abhi



On May 4, 8:27 am, SheikhAman <[email protected]> wrote:
> I am using a VideoView to play videos.
> it works smoothly.
>
> with only one problem. i am able to provide path of video with this
> way-
>
> Uri uri = Uri.parse("android.resource://com.abc.def/"+ R.raw.vid);
> video.setVideoURI(uri);
> video.start();
>
> but this is not what i want.
> i want it to take the path dynamically, so that i can tell it the path
> according to the user selection.
>
> any suggestions??
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group 
> athttp://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to