本文介绍了如何保持轨道的活动在活动堆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想跟踪所有的活动在活动栈。有谁知道如何从code做到这一点?
I'd like to keep track of all activities in the activity stack. Does anyone know how to do this from code?
推荐答案你为什么要来跟踪活动一叠... 但是,有一种方法来操作使用意图的标志堆栈。 例如:
Why do you want to keep a track of activity stack... But there is a way to manipulate the stack using intent flags. Example:
Intent intent=new Intent(this, MainActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(intent);此标志将清除所有的运动,从堆栈,present以上MainActivity,并启动MaintActivity。 还有其他的标志操纵堆栈以及.. 希望这有助于
This flag will clear all the activites, from the stack, present above MainActivity, and launch MaintActivity. There are other flags to manipulate the stack as well.. Hope this helps
更多推荐
如何保持轨道的活动在活动堆
发布评论