开发者

What is the best way for pick a video in Android

开发者 https://www.devze.com 2023-02-15 06:36 出处:网络
I got a perfect Intent.ACTION_PICK with my picture. startActivityForResult(new Intent(Intent.ACTION_PICK,

I got a perfect Intent.ACTION_PICK with my picture.

startActivityForResult(new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI), SELECT_IMAGE);

But it doesn't work with video. When i click on a video of my list, it play the vidoe instead of send me back.

startActivityForResu开发者_JS百科lt(new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Video.Media.INTERNAL_CONTENT_URI), SELECT_VIDEO);

What is the best way for pick a video in Android

An idea ?


You want to use Intent.ACTION_GET_CONTENT and specify video/* for the type to pass to Intent.setType. See Stackoverflow - Android access videos and photos on Android 1.5 for an example.

0

精彩评论

暂无评论...
验证码 换一张
取 消