I know it is asked before and I have tried:
Intent intent = new Intent(Intent.ACTION_PICK); intent.setType("video/*, images/*"); startActivity(intent);
But in my Samsung S2 it opens the gallery in selection mode (if I click an item it closes the gallery app). I just wish to open the gallery in normal mode so I can click images and videos and watch them and that is it!
I wasted too much hours for this.... Please help me!Answer1:
Intent intent = new Intent(Intent.ACTION_VIEW);
Activity Action: Display the data to the user. This is the most common action performed on data -- it is the generic action you can use on a piece of data to get the most reasonable thing to occur. For example, when used on a contacts entry it will view the entry; when used on a mailto: URI it will bring up a compose window filled with the information supplied by the URI; when used with a tel: URI it will invoke the dialer.
Output: nothing.</blockquote> Answer2:
I just wish to open the gallery in normal mode so I can click images and videos and watch them and that is it!</blockquote>
There are countless "gallery" apps, both pre-installed on devices and available for download from the Play Store. There is no requirement for any of them to expose some specific
Intent to show "normal mode", even assuming that the app has something that would correspond to "normal mode".
In other words, there is no reliable way to do what you seek.Answer3:
This works for me:
Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(Uri.fromFile(file), "application/*"); startActivity(intent);
Also check this link:
<a href="http://indyvision.net/2010/03/android-using-intents-open-files/" rel="nofollow">Using Intents to Open Files</a>Answer4:
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(
Font: <a href="https://stackoverflow.com/a/6016311/2652124" rel="nofollow">https://stackoverflow.com/a/6016311/2652124</a>