based on Toggle button value divert controll to different activities

view story

http://stackoverflow.com – I have made an application in that i have some activities,from them one activity has a toggle button,Now i want is that when i press togglebutton to "yes" then if i press on back next button of "Activity2.java" it should go to "deposit.java" else it should go to activity3.java. my code for activity(contains togglebutton); Activity1.java package com.theappgeeks.kevingreenwealth; import android.os.Bundle; import android.app.Activity; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.view.KeyEv (HowTos)