简体   繁体   English

如何在 Android java 中“杀死”一个意图

[英]How can I “kill” an intent in Android java

The title is probably not the best but I will try to explain my problem.标题可能不是最好的,但我会尽力解释我的问题。

I have a login/signup page where I can click on a facebook button to login through or I can click on a mail button.我有一个登录/注册页面,我可以在其中单击 Facebook 按钮进行登录,也可以单击邮件按钮。

When I click on this button, I open a new activity with a form to sign up.当我单击此按钮时,我会打开一个带有表单的新活动以进行注册。 I want this activity to be transparent to a certain extent to see my first login/signup in the background page which is done.我希望此活动在一定程度上透明,以便在完成的后台页面中查看我的第一次登录/注册。 On this same page (sign up page), I have another button "I already have an account" that opens a new login activity.在同一个页面(注册页面)上,我有另一个按钮“我已经有一个帐户”,可以打开一个新的登录活动。

This login activity is also transparent but the background is the sign up form and not my first page which is normal but I don't know how to get my first page as a background.此登录活动也是透明的,但背景是注册表单,而不是我的第一页,这是正常的,但我不知道如何将我的第一页作为背景。

Any advice ?有什么建议吗?

在此处输入图片说明

在此处输入图片说明

Regards,问候,

Arnaud阿诺

Call finish() when you move to your signin page.当您移动到登录页面时调用finish() This'll finish the signup form and the first page will show up as your background.这将完成注册表单,第一页将显示为您的背景。

You just need to call finish()你只需要调用finish()

Intent intent = new Intent(this, NextActivity.class);
startActivity(intent);
finish();

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

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