如何保持轨道的活动在活动堆

编程入门 行业动态 更新时间:2024-10-19 15:38:59
本文介绍了如何保持轨道的活动在活动堆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想跟踪所有的活动在活动栈。有谁知道如何从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

更多推荐

如何保持轨道的活动在活动堆

本文发布于:2023-10-31 16:11:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1546602.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:轨道

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!