My app contains a section where I have to load images from gallery and show them there. Please guide me how I can do that. I also want to make folders in which the photos will be placed. Thanks in advance for your help!
Intent gallery = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.INTERNAL_CONTENT_URI);
startActivityForResult(gallery,PICK_IMAGE);
I've tried the above code it selects the image and shows it on my app but when I restart my app the image disappears.
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK && requestCode == PICK_IMAGE) {
imageUri = data.getData();
imageView.setImageURI(imageUri);
}
}