Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best way for pick a video in Android

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);

enter image description here

An idea ?

like image 296
zobi8225 Avatar asked Mar 08 '11 09:03

zobi8225


1 Answers

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.

like image 174
typo.pl Avatar answered Oct 31 '22 18:10

typo.pl