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

UserVisibleHint is deprecated #4408

Open
DavidMarquezF opened this issue Jun 3, 2022 · 0 comments
Open

UserVisibleHint is deprecated #4408

DavidMarquezF opened this issue Jun 3, 2022 · 0 comments

Comments

@DavidMarquezF
Copy link
Contributor

In androidX UserVisibleHint is deprecated. I guess it would be good to move away from using it.

According to this stack overflow answer the equivalent would be:

For UserVisibleHint = false

.getSupportFragmentManager()
            .beginTransaction()
            .setMaxLifecycle(fragment, Lifecycle.State.STARTED);

For UserVisibleHint = true

.getSupportFragmentManager()
            .beginTransaction()
            .setMaxLifecycle(fragment, Lifecycle.State.RESUMED);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant