0

I am having many activity in my application.

Consider very first screen I show is login screen after successful login I will show another activity which will be the user home screen.

My question is when the user click home key and then touch my application icon I am getting login scren instead of user home screen.

Deatils.

LoginScreen launchMode is "singleTask"

action android:name="android.intent.action.MAIN"

category android:name="android.intent.category.LAUNCHER"

User Home screen launchMode is "singleTask".

Mahesh Babariya
  • 4,560
  • 6
  • 39
  • 54
Sureshkumar Menon
  • 1,165
  • 7
  • 27
  • 49
  • Check the answer to this question: http://stackoverflow.com/questions/5790973/remove-start-activity-from-the-history/5791306#comment-6639338 – Flo Apr 27 '11 at 12:09
  • But when i click home key my home screen activity should be in onPause state and when i click home key it should resume but after using nohistory i am still getting my login screen and thwn when i pres back i am getting home screen. what to do – Sureshkumar Menon Apr 27 '11 at 12:24

1 Answers1

0

Check in the onResume() method of your login activity if the user is already logged in. If he/she is already logged in then start the next activity and call finish() on the login activity.

I would always pass the action flow through the login activity, so you have a central point where you can check whether the current user is authenticated properly.

Flo
  • 27,355
  • 15
  • 87
  • 125