Sobes.tech
Junior — Middle

Is it possible to display a Fragment that is in the onStop state?

sobes.tech AI

Answer from AI

A fragment in the onStop state is not visible to the user because it is stopped and inactive. Displaying (making visible) a fragment in this state is impossible — to display a fragment, it must be in the onStart or onResume state.

If you need to show a fragment, you should perform a fragment transaction that brings it to an active state, for example:

supportFragmentManager.beginTransaction()
    .show(fragment)
    .commit()

This will transition the fragment from the onStop state to active and make it visible.

Is it possible to display a Fragment that is in the… - sobes.tech