Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OnActivityResult Deprecated in latest Android X AppCompatActivity #330

Open
GulajavaMinistudio opened this issue Jun 8, 2021 · 4 comments

Comments

@GulajavaMinistudio
Copy link

Basic Information

Device type: Android with version 10 and 11
OS version: Android 10 and Android 11
EasyPermissions version: 3.0.0

Describe the problem

AppSettings dialog need onActivityResult for Appsettings dialog callback. And for this case, onActivityResult is deprecated on latest Android X Appcompat activity version.

https://stackoverflow.com/questions/62671106/onactivityresult-method-is-deprecated-what-is-the-alternative

https://developer.android.com/training/basics/intents/result

JbJvj

@vishalkumarsinghvi
Copy link

@GulajavaMinistudio onRequestPermissionsResult also deprecated and I am also waiting for new version , if you found something please write down below so it will be helpful for me
Thanks :)

@chitgoks
Copy link

@vishalkumarsinghvi did they confirm they will update the lib that will handle that deprecation?

@vishalkumarsinghvi
Copy link

@chitgoks No response

@JRobertson90
Copy link

JRobertson90 commented May 6, 2022

I also wish they would update the library but you can still use an activity launcher without even modifying the library:

AppSettingsDialog dialog = new AppSettingsDialog.Builder(this).build();
@SuppressLint("RestrictedApi") Intent intent = AppSettingsDialogHolderActivity.createShowDialogIntent(this, dialog);
appSettingsDialogLauncher.launch(intent);

and your launcher in your activity or fragment would look like this:

private final ActivityResultLauncher<Intent> appSettingsDialogLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> {
    // handle result here
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants