In android external storage not means external drive but anything external to application. Even "File Explorer" and "Gallery" seems to act as external for an application.
(MediaStore.Images.Media.EXTERNAL_CONTENT_URI)
, this will go to external storage like gallery and pick the image and return it in from of a Uri data.
Here is an example function to pick the image from the gallery:-
fetchImageButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent image = new Intent(Intent.ACTION_PICK);
image.setData(MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(image,1000);
}
});
This will simply make an intent whose job is to pick the content(Intent.ACTION_PICK), then using intent object we try to fetch the data(Uri) from the gallery and then start the activity passing intent "object" and "RequestCode".