Hi! I’m looking for a nice way to close my app. I see many games with the “exit” button and I wanna some look it.
I have 3 Activities and I try with System.exit, Activity.finish… but not work good, because close mi main activity but then goes to my third activity :S
Activity 1: Whe i go to the activity 2, i call finish activity 1 and startActivity 2.
Activity 2: Whe i go to the activity 1, i call finish activity 2 and startActivity 1.
Only one activity is “open” at the same time.
If i need save some value i use SharedPreferences or sometimes putExtra(KEY,VALUE). In this way when you click a exit button menu call finish on these activity and the app is destroyed. After the SO finish him of RAM when needed.