I'm trying to display only gallery and File manager in the chooser intent
So, i tried something like below
Intent intent = new Intent();
intent.setType("image/*");
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
intent.putExtra(Intent.EXTRA_LOCAL_ONLY,true);
intent.setAction(Intent.ACTION_PICK);
startActivityForResult(Intent.createChooser(intent, "Select Picture"), RESULT_LOAD_IMAGE);
But along with gallery and File Explorer it is showing other apps too. It is also showing google drive
So, i decided to choose only first two intents and remove others.
How to achieve this ?
For your case the easiest way to achieve what you need is
to add below line
intent.setData(android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
By adding above line you can get rid of installed apps by user. but be aware of one thing
intent.setAction(Intent.ACTION_PICK);
you will see Gallery, File Manager, and Any Inbuilt photo app provider by manufacturer of phone.intent.setAction(Intent.ACTION_GET_CONTENT);
along with above you will also see Google drive.Don't go for first two chooser intents it is not recommended and I don't know the reason, Also I don't know how to do that.
Hope, This gives a proper explanation with answer.