Pergunta

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()?

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top