I’ve googled this and googled this. Perhaps my terminology is wrong. I have a normal activity. I have a button called go to background mode. When the user presses this button, I want the activity to just go into the background (like it would normally do on the back button)
However, I want to prompt the user with an alert dialog: “Do you wish to enter background mode?”
If the user hits “Yes” THEN go to background, if no, then stay on current screen/activity.
For this, I am overriding ONBackPressed(). If the user hits, “YES”, how to I put my activity into the background?
Thanks!
What does “put into the background” mean? Android has an activity stack, once you go back one activity, you can’t go back forward. So in that sense, you just close your activity.
If you want your application to keep running and do its stuff in the background, you’ll have to resort to Services.