Why is "setMaxLifecycle" an alternative to "getUserVisibleHint"?

Viewed 99

I am new to android development. I'm importing "androidx.fragment.app.Fragment".

'getUserVisibleHint()' is deprecated. So, I want to use setMaxLifecycle(). But, I can't understand.

Why is "setMaxLifecycle" an alternative to "getUserVisibleHint"? Why is "set" an alternative to "get"?

if (getUserVisibleHint())
{

}

Will this happen? What do you set in the argument? I don't understand at all even if I read the reference.

if (setMaxLifecycle())
{

}
0 Answers
Related