简体   繁体   English

android活动永远在最前面

[英]android activity always on top

There are 2 activities: A and B 有2个活动:A和B
if activity A is started then it will be always on top of activity B (if B exist) 如果活动A已启动,则它将始终位于活动B的顶部(如果B存在)
if B is started and A is in foreground then B will go right under A 如果启动了B并且A在前景中,那么B将在A的正下方
if A is going in background or is closed then(if B exist) B will be shown 如果A在后台运行或关闭,则(如果B存在)B将显示

each activity is running in its own task 每个活动都在自己的任务中运行

In other words is there a simple way to start an activity right under the current activity so when that close then it will be shown 换句话说,有一种简单的方法可以在当前活动的正下方开始一个活动,因此当该活动关闭时将显示该活动

what is the simplest way to do this using manifest flags preferably 最好使用清单标志来做到这一点的最简单方法是什么

Start A inside new Task stack. 在新的任务堆栈中启动A。 Read docs for Intent . 阅读Intent文档。

Inside onCreate of A check Intent and open B. 在A的onCreate内检查Intent并打开B。

Now you have new stack where B is above A, however and A and B were used before. 现在您有了新的堆栈,其中B高于A,但是之前使用过A和B。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM