Combine ACTION_PICK and ACTION_GET_CONTENT when selecting an icon

This commit is contained in:
Alexander Bakker 2020-07-15 12:53:16 +02:00
parent 21b588dc8b
commit a9ccf412e7

View file

@ -392,8 +392,12 @@ public class EditEntryActivity extends AegisActivity {
Intent galleryIntent = new Intent(Intent.ACTION_PICK);
galleryIntent.setDataAndType(android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI, "image/*");
Intent fileIntent = new Intent(Intent.ACTION_GET_CONTENT);
fileIntent.setType("image/*");
Intent chooserIntent = Intent.createChooser(galleryIntent, getString(R.string.select_icon));
startActivityForResult(Intent.createChooser(chooserIntent, getString(R.string.select_icon)), PICK_IMAGE_REQUEST);
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, new Intent[] { fileIntent });
startActivityForResult(chooserIntent, PICK_IMAGE_REQUEST);
}
private void startEditingIcon(Uri data) {