Question

Is it possible to set a new layout for a fragment, in a way similar to Activity.setContentView? Or the only way to change the layout of a fragment is to replace it, and inflate a different layout during onCreateView()?

Was it helpful?

Solution

The answer is no. So far I have not found much use with fragments, the only thing good is that it has its own life cycle methods. The draw back is that the fragment transition is a pending intent, that can cause problems sometimes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top