ArnaudT
ArnaudT

Reputation: 93

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.

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 ?

enter image description here

enter image description here

Regards,

Arnaud

Upvotes: 0

Views: 2430

Answers (2)

Giridharan
Giridharan

Reputation: 4462

You just need to call finish()

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

Upvotes: 1

Shivam Verma
Shivam Verma

Reputation: 8023

Call finish() when you move to your signin page. This'll finish the signup form and the first page will show up as your background.

Upvotes: 1

Related Questions