Answer the question
In order to leave comments, you need to log in
How to manage fragment creation?
Now the fragment is inserted through the xml fragment tag and the activity inherits OnFragmentInteractionListener
How can I make sure that the fragment does not appear after the creation of the activity, but is created / destroyed, for example, using a switch. It is the creation / destruction that is needed, and not the change of visibility.
Answer the question
In order to leave comments, you need to log in
Don't use fragments in xml. Use FragmentManager and add/replace/remove.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question