Pergunta

I have a list view in Android. During every click of list item, I have load a Single view name "Template Fragment" for every click dynamically. After click on Sub Views, I have loaded the same View "Template Fragment" again dynamically. Now I have multiple views creating from the same Fragment. Now my problem is to maintain back stack of all the views. How I can achive this.

Please help me for the same.

Thanks in advance. Any help is appreciated.

Foi útil?

Solução

use the following code,

//add to back stack
transaction.addToBackStack(type.getClass().getName());

//Commit the transaction
transaction.commit();

String as parameter might help in identifying fragments

In case you don't need to identify this back stack later on, pass null for addToBackStack.

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