If you start an activity using startActivityForResult, you can call finish() in this new Activity when you're done with it and it will return control to the activity that started it.
On Mar 30, 6:40 am, mak_boney <[email protected]> wrote: > hey i am a beginner... > > i'm in a small problem... > > i have three activities (suppose A,B,C) > > after performing onclick event in activity A, i can go to activity B > and then C... > > my question is that is there any way to comeback activity A from > C..here is the code snippet... > > public void onCreate(Bundle savedInstanceState) { > super.onCreate(savedInstanceState); > setContentView(R.layout.main); > Button next = (Button) findViewById(R.id.Button01); > next.setOnClickListener(new View.OnClickListener() { > public void onClick(View view) { > Intent myIntent = new Intent(view.getContext(), > Activity2.class); > startActivityForResult(myIntent, 0); > } > > }); > } > ___________________________________________________________________ > > public void onCreate(Bundle savedInstanceState) { > super.onCreate(savedInstanceState); > setContentView(R.layout.main2); > > Button next = (Button) findViewById(R.id.Button02); > next.setOnClickListener(new View.OnClickListener() { > public void onClick(View view) { > Intent myIntent = new Intent(view.getContext(), > Activity3.class); > startActivityForResult(myIntent, 0); > } > > }); > } > __________________________________________________________________ > > public void onCreate(Bundle savedInstanceState) { > super.onCreate(savedInstanceState); > setContentView(R.layout.main3); > > Button next = (Button) findViewById(R.id.Button03); > next.setOnClickListener(new View.OnClickListener() { > public void onClick(View view) { > //Intent i =new Intent(); > //setResult(RESULT_OK,i); > //finish(); > > Intent myIntent = new Intent(view.getContext(), > makboneyp3.class); > startActivityForResult(myIntent, 0); > //int pid = android.os.Process.myPid(); > //android.os.Process.killProcess(pid); > } > > }); > > } > > though this is working...is there any other way without calling from C > > plz help me.... > > thanks in advance.... -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en To unsubscribe, reply using "remove me" as the subject.

