在Android中挑选视频的最佳方法是什么 [英] What is the best way for pick a video in Android

查看:112
本文介绍了在Android中挑选视频的最佳方法是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的照片有完美的 Intent.ACTION_PICK .

startActivityForResult(新 意图(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI), SELECT_IMAGE);

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(新Intent(Intent.ACTION_PICK,android.provider.MediaStore.Video.Media.INTERNAL_CONTENT_URI), SELECT_VIDEO);

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

一个主意?

推荐答案

您要使用Intent.ACTION_GET_CONTENT并指定video/*作为要传递给Intent.setType的类型.有关详情,请参见 Stackoverflow-Android访问Android 1.5上的视频和照片一个例子.

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.

这篇关于在Android中挑选视频的最佳方法是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆