U can make use of a default constructor to close and open screen
if u want to move between screens
1-2-3-4
&&
4-3-2-1 android it self take care of it.. for this u no need to worry
for example if u want traverse in a specific way like
4-2-3-1
android doesn't allow u
so simply create constructor and assign present activity to it and make use of that variable close screen at any time
Here is the sample shows how to do it.....
Here is the activity class
public class One extends Activity
{
private One Screen;
public One()
{
Screen=this;
}
when u want close this activity simply use
Screen.finish();
instead of this.finish();
when u want invoke new activity of u r liking simply use
Screen.finish();
Intent i = new Intent(One.this, YourActivity.class);
Log.i(TAG, "calling YourActivity Screen");
startActivity(i);
if u want pass any data between the screens u can make use of
i.putExtra("valuename", actualvalue);
and u can retrive the value using
Intent startIntent = getIntent();
String actualvalue = startIntent.getStringExtra("valuename");