使用 Android TaskManager 将 Activity 置于前台

发布于 2024-12-02 12:21:00 字数 267 浏览 3 评论 0原文

我遇到了将 Activity 放在前面的问题。

  1. 当应用程序启动时,用户设置一些时间(活动 1)
  2. 现在应用程序显示倒计时时间随着时间的减少(活动 2)
  3. 现在我按下主页按钮。
  4. 选择任务管理器,选择列表中显示的我的应用程序,然后选择“切换到”将应用程序置于最前面,而不是活动 2,它最终出现在活动屏幕 1 上。

我该怎么做才能使任务管理器切换到最前面最近的活动

I am running into an issue with bring up an Activity to the front.

  1. When the app is launched the user sets some time (Activity 1)
  2. Now the app shows a count down time with time decreasing (Activity 2)
  3. Now I press the home button.
  4. Choose Task Manager, select my app shown in the list and select "Switch To" to bring the app to the front, instead of Activity 2 it ends up on the Activity Screen 1.

What can I do so the task manager switches to the most recent Activity?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

看海 2024-12-09 12:21:01

确保启动 Activity 2 时没有使用 FLAG_NEW_TASK。

Make sure you are not using FLAG_NEW_TASK when launching Activity 2.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文