I am trying to reproduce some exceptions my android application is getting during my activity's Image Chooser intent:
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture"), INTENT_REQUEST_GALLERY);
Does anyone know how I can reproduce the steps that return a picasa content provider uri like this:
content://com.google.android.gallery3d.provider/picasa/item/5893756913818770722
Related
I am trying to pick a text file with a file picker. I am getting this error alert No apps can perform this action . My code is:
Intent intent = new Intent();
intent.setType("*/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select File"), SELECT_FILE);
It also doesn't display text files if I use intent.setType("*/*");. How should I fix my problem?
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.
When picking a file from the Library, only photos are listed. Video files should also be shown.
Im Using this code
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(Intent.createChooser(intent, "Select Picture"),SELECT_PICTURE);
use following for pick both images and videos.
Intent mediaChooser =new Intent(Intent.ACTION_GET_CONTENT);
//comma-separated MIME types
mediaChooser.setType("video/*, images/*");
startActivityForResult(mediaChooser,IMAGE_PICK);
I'm working on an app that needs to have the user select an image or video. On pre-2.1 devices, using ACTION_GET_CONTENT seems to work fine with multiple MIME types:
new Intent(Intent.ACTION_GET_CONTENT).setType("video/*, image/*")
However, on a Droid running 2.1, this gives a "There are no items in your collection". Using the same code with either "video/" or "image/" gives the desired result. Is there a way to get my 2.1 device to allow the user to select both types of content within a single Intent?
Putting the request into a function and then calling the function with onClick().
public void openGalleryImage(){
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent,"Select Image "),
SELECT_IMAGE);
}
public void openGalleryVideo(){
Intent intent = new Intent();
intent.setType("video/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent,"Select vVideo "),
SELECT_VIDEO);
}