O
O
orbit0702019-06-19 08:14:43
Android
orbit070, 2019-06-19 08:14:43

How to properly delete/terminate an activity from another activity?

Hello.
On the first activity, the user enters a phone number and goes to the second one, where they need to enter the code from SMS. In this case, the first activity is not deleted so that the user can return to it (for example, if he entered the number incorrectly).
If the user enters the correct code, then the transition to the third activity is carried out. When transitioning, I can call finish() on the second activity (with which the transition is made), but what about the first activity? how to remove it correctly?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Borisov, 2019-06-24
@tatiana6666

I use always 1 main activity (mom) which is never deleted. From it you can go to 2.3 ... and so on. But the main one always works. Try to structure like this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question