完成活动组中的活动

发布于 2024-10-30 14:00:50 字数 299 浏览 6 评论 0原文

我有一个问题,看起来像这样。我有 5 个活动组和 1 个 tabHost,其中有 5 个选项卡,每个选项卡都附加一个活动组。每个活动组中有一个登录活动。

条件:

  1. 当我们点击 1、2、3、4 和 5 选项卡时,将显示登录活动。//根据要求。
  2. 登录后,另一个活动启动,这些活动添加到活动组中。

问题:

当我们登录后按后退按钮时,会显示登录表单,我想在登录后将其删除。我已经使用了 Android sdk 提供的所有整理方法,如 finish()、finishFormChield() 等。

I have a problem look like this. I have 5 activity group and 1 tabHost with 5 tab and every tab is attached with one activity group. In each activity group a Login activity.

Condition:

  1. When we tap with in 1,2,3,4 and 5 tab the Login activity is show.//according to requirement.
  2. After login another activity is start and these activity add in activitygroup.

Problem:

When we press back button after login the the login form is show I want to remove it after login. I have use all the finishing method provided by Android sdk like finish(), finishFormChield() and others also.

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

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

发布评论

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

评论(1

猫瑾少女 2024-11-06 14:00:50

在登录活动中,当您启动 Intent 时,立即包含 finish()。这会终止当前的 Activity,如下所示:

Intent intent = new Intent(first.java,second.class);
startActivty(intent);
finish();

您还可以尝试在该 Activity 的 Android 清单文件中包含 android:launchMode="singleInstance",如下所示:

单实例活动

In the login activity when you start intent, immediately include finish(). This kills the present activity as shown below:

Intent intent = new Intent(first.java,second.class);
startActivty(intent);
finish();

You can also try with including android:launchMode="singleInstance" in your android manifest file for the activty as shown below:

single instance activity

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