Is it possible to change the appearance of the fragment (set another View ) during its operation, or is it possible only in the onCreateView() method?

In other words, is it possible to use the setContentView() method somewhere else?

  • one
    the fragment has no setContentView () method, it is an activity method. See this answer about markup spoofing. - pavlofff
  • @pavlofff, thanks! Now I understand what's what. - Streletz

1 answer 1

It all depends on what you need to change! If you hide something / show / color something, then work with the same fragment. If the logic of behavior must also change, then it will be appropriate to use child fragments with which you can “juggle” as necessary.

  • Clarified the question. - Streletz