Go back to specified screens only using back botton in android
<p>App having screen1, screen2, screen3 , screen4</p>

<p>user can go to screen3 from remaining 3screens</p>

<p>if user clicks on back button in screen3 </p>

<p>then he should be redirected to screen1(if he comes from screen1) or screen2 (if he comes from screen2)</p>

<p>but should not go to screen4</p>

<p>i tried finish()  in screen3</p>

<p>functionality is missing</p>

<p>how can i solve this,
please help me 
Thank you in advance.</p>
