I would like to display some images when the application is opened for the first time. Or if its being reopened. I don’t want the application to be killed when the user presses the back button, to go to the home screen. But instead keep it alive but still return to the home screen.
Share
As Andro_Selva said, the back button finishes your activity; it doesn’t kill the app.
If you want to accomplish something similar to pressing the home button (so your app is hidden, but the activity is still alive), you can do something like this:
It’s a little different than pressing the home key, because it will only take you to last app you were in when you launched this app. So it won’t necessarily take you back to the launcher. But this behavior will be closer to what the user expects when pressing back.
You may also want to put this in the Manifest under your root Activity :
This will prevent Android’s default behavior of finishing all your Activities if they have been idle for about half an hour.