Reputation: 4860
I am programming an Android application and have a curious issue.
My application has a LoginActivity that defines the filter for launch events.
As soon as login is complete, it starts the "Home" activity using startActivity(new Intent(LoginActivity.this, HomeActivity.class))
and stops the LoginActivity using finish()
.
The HomeActivity is a simple dashboard with notifications, overriding onCreate
and onStart
. Also it updates the some content icons using an AsyncThread.
The problem is this: If I hit the Home-Button to exit my app and then use the "recent" menu (holdpress the Android-Home Button) to reopen it, the back-key is 'broken' in my app: Pressing it will not finish the HomeActivity, but instead loop back to the same activity:
Meaning ... HomeActivity <- HomeActivity <- HomeActivity <- HomeActivity ...
I have not used any hacks to override the backstack or back key behaviour. Anyone got a clue what the cause of this may be?
TIA, Patrick
Upvotes: 2
Views: 689
Reputation: 63955
Maybe your login activity detects that login is complete and sends you immediately back to your home activity. That should be visible from the log (ActivityManager, START intent ...
)
In that case it may be a good idea to play with the backstack
Upvotes: 2