I'm trying to load images from gallery using the following code
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture"), PICK_IMAGE);
The code works fine, however by default it loads only the recent photos. I have to click the menu to go to the "images" that show all images. Is there a way for me to load the image so by default it shows all "images" instead of the recent photos. Thank you.
Related
I want to add a folder of free images to my app, so that the user easily finds it with
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_OPEN_DOCUMENT);
startActivityForResult(Intent.createChooser(intent,
"Select image"), SELECT_IMAGE);
(Next step would be do let user click something to download another folder, perhaps at a cost.)
I only find ways to add images to the app so that direct links to the images can be shown in the app, but I didn't figure out how to let those image be part of the selection shown with the code above.
I am trying to Load Images from gallery into my application folder. I am using Recyclerview
By using this Intent i am able to select Multiple Images from Gallery but don't know how to get images in my applications folder. Note I have different folders in my application.
private void OpenFromGallery() {
Intent intent = new Intent();
intent.setType("image/*");
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture"), 1);`}
Hope it will works for you
Click here
If we have to get the image file from device then we have to write following code:
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Choose Picture"), 1);
But what we have to do if we don't want to choose only image and video files.
I want that the file chooser window should show all the files except image and video.
We have a website where on mobile and specifically android devices when people want to change their "avatar" image the options that show up when we click on "upload" does not have the "Gallery". Instead it has "Documents" is there a way to define what to show and what not to show?
We are using PHP if that matters at all for development.
Please see below image.
well it depends on which intent you have used for upload button, in my opinion the most appropriate intent to call when you want user to select an image would be
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture"), PICK_IMAGE_REQUEST);
it would make the gallery and other photo handling apps visible in the chooser dialog.
for more information you can go here
Hope it helps
I am using following code to select multiple images from the gallery
Intent intent = new Intent();
intent.setType("image/*");
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent,"Select Picture"), 1);
This works fine and I can select multiple images from the gallery. But what I want to do now is to import all the selected images in our app and populate those images in the form of a ListView. Can anyone suggest anything that might help me. Thanks in advance.
After you copy the selected images, you will have to display them on a list view.
Some code example to import/copy the selected images can be found here :
http://viralpatel.net/blogs/pick-image-from-galary-android-app/
The best documentation of Android to display images in a list view is here : http://developer.android.com/training/displaying-bitmaps/display-bitmap.html .