- Create three activities - A, B and C
In Activity A - when calling startActivity(B), call finish() also. Example -
public void onButtonClick() // Some method { startActivity(intentForB); finish(); }
Similarly when going to C from B -
public void onButtonClick() { startActivity(intentForC); finish(); }
When the user is on Activity C and when he presses the back button , the application will get closed.(No need to write back button handling explicitly).
Hope this helps.