在Android中挑选视频的最佳方法是什么 [英] What is the best way for pick a video in 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屋!