In my app, I’ve noticed a difference when using the home button.
Ex.
I press app icon, and the app starts op like it should with Activity(A). When I press Home button, the app gets minimized as it should. When I press app icon again, the app resumes with onResume() with Activity(A)
Now for the tricky part.
From the app, when I press my “Start button” another Activity(B) is launched, and focus is changed to the new Activity(B). When I press Home, the app minimizes (like its supposed to).
And now for the problem:
If I press the app icon, my app starts op from the very beginning with Activity(A) where my start button is. (And not with ActivityB which I just minimized)
If I do the scenario over again (Start app – > focus to Activity(B) -> Press home) and this time long press the home button, and the “Recently launched” comes op, and I select my app. Now the focus resumes to Activity(B)
Both Activity(A) and Activity(B) are set to SingleTop.
My question is, why is there a difference when using the different combinations of LongPress home + icon and OneClick Home + icon
So now when you Long Press Home button..That shows you recent apps with saves state of last shown Activity..that’s why when you open from there..you see Activity B directly without SplashScreen.
And Simple Pressing Home Button Once,you are went to Home Screen from where you are opening Applications Screen which is Launcher Screen..from there If you press any Icon that particular app will be Launched(Means to open the app from its Main Activity that is defined in Manifest with Intent Filter set to Launcher)…That’s why opening an app from there will always show you,your SplashScreen.
Same button is used to perform two different events,cause they are related..but It’s not like both event performs the same actions.