Android activity stack and back function problem?

In Activity A public void onCreate() { //when you want to start new activity startActivity(intent); //starting activity to B } in Activity B public void onCreate() { when you want to start new activity startActivityForResult(intent, 10//any code value); //starting activity to c } protected void onActivityResult(int requestCode, int resultCode, Intent data) { if(resultCode==25) { finish() } } in Activity C public void onCreate() { when you want to go back to Actitvity A setResult(25) finish() } Explanation 1)in activity "A" your starting one fresh activity to "B 2)in "B" activity ,ur starting one activity to "C" ,using startActivityForResult method 3)in "C" activity ,when you finish,it obviously go to "B" activity,with result code which you set. And if it's match it will close "B" activity ,and go to "A" activity 4)This is one simple trick to skip one or more activity.

In Activity A public void onCreate() { //when you want to start new activity startActivity(intent); //starting activity to B } in Activity B public void onCreate() { //when you want to start new activity startActivityForResult(intent, 10//any code value); //starting activity to c } protected void onActivityResult(int requestCode, int resultCode, Intent data) { if(resultCode==25) { finish(); } } in Activity C public void onCreate() { //when you want to go back to Actitvity A setResult(25); finish(); } Explanation 1)in activity "A" your starting one fresh activity to "B" 2)in "B" activity ,ur starting one activity to "C" ,using startActivityForResult method 3)in "C" activity ,when you finish,it obviously go to "B" activity,with result code which you set. And if it's match it will close "B" activity ,and go to "A" activity 4)This is one simple trick to skip one or more activity.

For example, in C. If you call finish() after you send the intent to start Activity D when the user presses the back button in Activity D she/he will be sent to Activity A or B depending where you started activity C. Another way is to set flag to clear top like this: Intent intent = new Intent(this, LoginActivity.

Class); intent. SetFlags(Intent. FLAG_ACTIVITY_CLEAR_TOP); startActivity(intent); The easiest way is to call finish() depending on how you want the flow in your app to be.

App starts with activity A, then it goes to B by using explicit intend, then C and then D in same way. From D, if I want to come back to directly B or A, how it can be done?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions