just override the onBackPressed () method and startactivity B in activityc and startactivity a in action b.
in action c have the following code:
public void onBackPressed(){ startActivity(new Intent(this,ActivityB.class)); finish(); }
and in step b this code:
public void onBackPressed(){ startActivity(new Intent(this,ActivityA.class)); finish(); }
and in action a have the following code:
public void onBackPressed(){ finish(); }
source share