October 21, 2024
Chicago 12, Melborne City, USA
java

ActivityResultLauncher cannot resolve method


I try use this code for pick an image:

ActivityResultLauncher<PickVisualMediaRequest> pickMedia =
            registerForActivityResult(new ActivityResultContracts.PickVisualMedia(), new ActivityResultCallback<Uri>() {
                @Override
                public void onActivityResult(Uri uri) {
                    if (uri != null) {

                    }
                }
            });

But this signature is absent, I can see it via source code of package androidx.activity.result.
But Android Studio show as hint two other signature with additional parameters, I tried use them but fail too.

I use androidx.activity:activity:1.9.2



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video