Domanda

Stavo cercando un modo per eliminare una certa attività dallo stack della storia e ho trovato una soluzione qui (Anwer di Wakkas) .Tuttavia, se chiudo l'app con questa attività aperta ad es.Premendo il pulsante Home, e successivamente ritorna ad esso, l'attività non viene ripristinata.

Se rimuovo l'attributo "Nohistory", sta tornando e ripristinato anche dopo un'uccisione.

C'è un modo per renderlo non apparire nello stack della cronologia (= non voglio tornare ad esso premendo il pulsante Indietro in Attività successiva) senza questo comportamento?

Cordiali saluti, Meduse

È stato utile?

Soluzione

I don't think so - leaving the activity via the "Home" button and opening a new activity will have the same effect: if your activity is not in the history stack, it should not be restored.

Instead of using the "noHistory" attribute, couldn't you just call finish() as you launch your next activity? It should not re-appear when you then hit the "back" button.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top