Android:OnStopの後の「nohistory」属性を使用してアクティビティに戻る方法は?

StackOverflow https://stackoverflow.com/questions/6045558

質問

歴史スタックから特定の活動を削除する方法を探していて、解決策ここ(Wakkasの午前)。ただし、このアクティビティでアプリを閉じた場合は、ホームボタンを押して後で戻っても、アクティビティは復元されません。

"nohistory"属性を削除した場合、それは戻ってきて、殺害後に復元されます。

この動作なしで履歴スタックに表示されないようにする方法はありますか?

親切 クラゲ

役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top