Intent intent = new Intent(Intent.ACTION_PICK);
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
intent.setType("image/*");
startActivityForResult(intent.createChooser(intent,""), PICTURE_REQUEST_CODE);
This is the code to open the gallery I'm using. When you open the gallery using this EXTRA_ALLOW_MULTIPLE, the General Gallery and Google Photo Selection window appear I don't want to make multiple choices in the gallery anyway, and I have to use Google Photos, so I don't want the gallery to appear in the selection window itself. Is there a way to display Google Photos right away other than calling ACTION_PICK?
android java
List<ResolveInfo> activities = packageManager.queryIntentActivities(intent,
PackageManager.MATCH_DEFAULT_ONLY);
In this way, you can obtain information about the application that can currently operate with that intent.
Also, if you look at the ResolveInfo document, there is a method to import packageName.
I think you can get the Google Photo package name with that method and start it right away without using createChooser.
© 2024 OneMinuteCode. All rights reserved.