Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

call android gallery for both image and video

Tags:

android

when i have to get some image or video

i did like this

 Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
    intent.setType("video/*");
    startActivityForResult(intent ,  ActNetwork.EXTRA_FLAG_SEARCH_LOCAL_VOD);

and

Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
    intent.setType("image/*");
    startActivityForResult(intent , ActNetwork.EXTRA_FLAG_SEARCH_LOCAL_VOD);

i try to

 Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
    intent.setType("image/* , video/*");

but in occured error

how can i solve that problem..

thanks your reply

like image 351
user876102 Avatar asked Aug 03 '11 07:08

user876102


1 Answers

Try this

final Intent galleryIntent = new Intent(Intent.ACTION_GET_CONTENT);
galleryIntent.setType("image/* video/*");
startActivityForResult(galleryIntent, REQUEST_CODE);
like image 155
Anton Klimov Avatar answered Sep 24 '22 13:09

Anton Klimov