What is the best way for pick a video in Android

。_饼干妹妹 提交于 2019-12-07 01:45:21

问题


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.

startActivityForResult(new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Video.Media.INTERNAL_CONTENT_URI), SELECT_VIDEO);

An idea ?


回答1:


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.



来源:https://stackoverflow.com/questions/5230615/what-is-the-best-way-for-pick-a-video-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!