Desenfoque
Desenfoque

Reputation: 816

clearTaskOnLaunch but considering this

Sorry for my english.

My "Root" activity (let's call it Activity A) is an activity that asks for a password. If the password is correct it should start another activity (B) with subactivities and so (B, C, D, etc).

When the user presses "back" in the Activity B, the app must exit (and not back to Activity A). To achieve this, I simply "finish()" Activity A after I call Activity B. This process works OK.

The problem is when the user presses "home" and then starts the app again, the app resumes from the last point and not from the Activity A.

I use 'android:clearTaskOnLaunch="true"', but it is not working because the "Root" activity is killed when the password is correct.

What is the best solution for this situation?

Thanks!

Upvotes: 0

Views: 480

Answers (2)

Dror
Dror

Reputation: 2588

You can try merging Activity A with Activity B. At the first, make the Log In controls visible. After you had validated the user, make the login controls invisible, and make all the other controls visible.

Upvotes: 1

hackbod
hackbod

Reputation: 91351

There are some tricks I can think of, but people will still be able to get to it through Recent Tasks. You should perhaps rethink your logic of when the user needs to re-enter a password.

Upvotes: 1

Related Questions