 <pre><code>public void onBackPressed() { Intent intent=new Intent(C.this, A.class); // remove below Flag and while going from A dont call finish(); //intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(intent); } </code></pre>