Hello i have the below code to open the gallery so that user picks an image.
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select file to upload "), 1);
I get the gallery and file explorer to choose from. How can I get only the android built in gallery.
I need this because I dont want the user to choose something other than images. Thanks
I don’t think it’s possible. The file explorer tells Android that it takes the same Intents to start as the Gallery, so Android displays a dialog for the user to select which one to use.
You’ll have to check their selection in your app once they pick it to make sure it’s a picture, and if it’s not then tell them and make them pick again.