android how to go previous visited activity when press button
<p>how to go previous activity after going like this  previous activity suppose i go activity1-->activity2 activity2--> activity3 activity3--> activity1 then how is work?? 
when i press button hwo is go back to activity1? i  use this but its not work tell me how to go previous visited activity?</p>

<pre><code>    Intent intent = new Intent(Activity4.this, Activity1.class);

startActivity(intent);


   i also use this code is not work for me
  Intent i = getIntent();
    i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    startActivity(i);

   //finish();    finish just previous acitivity is not work for me
</code></pre>
