File picker not displaying text files - android

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?

Related

How to load Images from Gallery in Recyclerview in android?

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

ACTION_GET_CONTENT except image and video files in Android

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.

How to test Picasa content provider in Android

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

want video and library both in gallery in android

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

Android open folder image with built-in gallery

I want to open a images folder with android built-in gallery.
For example, I have a folder path that contains images, i want to open it with gallery.
I am using this code, it opens the gallery that contains no images.
Any idea?
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(folderImages)),"image/*");
startActivityForResult(intent, 1);
Maybe try this one:
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, ""), 1)

Categories

Resources