Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Pick an image ..."), GALLERY_IMAGE);
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == GALLERY_IMAGE && resultCode == RESULT_OK && data != null) {
imageUri = data.getData();
uploadImage();
}
}
Comments
Post a Comment