views:

138

answers:

2

Hi,

In my application, I have problem with activity management. Indeed, consider I have 3 activities : - Splashscreen - SignIn - Home

I would see : - First launch (user not logged) : Splashscreen -> SignIn -> Home (log in valid) - Other launch (user registered) : Splashscreen -> Home (auto log)

The problem is : Back from SignIn or Home closes always the application. But with the first launch, back from Home go back to SignIn. How to prevents this ?

Thanks

A: 

Copy the code written in onCreate() of Home to onStart()..... Doing this along with some minor changes in other parts of the code will solve your problem...

Rohan K
A: 

In the manifest, set android:noHistory="true" For SignIn.

fredley
Thanks for your correct answer.But I have also an other activity launched by SignIn (forgotten password) and from this, I want to go back to SignIn and with android:noHistory="true" I can't :(
OlivierD
You can override `onBackPressed()` in your activity (from SDK 7 I think, there is another way of doing it for older SDKs, Google it) and manually start a new SignIn Activity if you are coming back from ForgottenPassword (you might want to set ForgottenPassword `noHistory=true` too).
fredley
Thanks for your solution.I didn't want to use Keypress event but finallys I think it's the unique solution.
OlivierD