Grant Uri permission to another activity
I'm trying to get image from device gallery and then show it in another activity. Code in my activity: private void startGallery() { Intent intent = new Intent(Intent.ACTION_GET_CONTENT); intent.addCategory(Intent.CATEGORY_OPENABLE); intent.setType("image/*"); startActivityForResult(intent, REQ_OPEN_GALLERY) } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == REQ_OPEN_GALLERY && resultCode == Activity.RESULT_OK) { Uri imageUri = data.getData() // here I save image uri to pass to another activity } } When I try to open uri in another