I have an app with several Activitys, whenever I change from Activity I execute the following commands:
Intent intent = new Intent(gerenciar2.this, excluir.class);
intent.putExtra("tabbanco", tabbanco);
intent.putExtra("pagina", page2);
startActivity(intent);
gerenciar2.this.finish();
Problem is that when I run the android hardware undo it closes the last opened activity thus closing the application.
Then I stopped executing the command MainActivity.this.finish();
only in my main activity, so when the user uses the undo it returns to the main activity.
Blz, so far so good.
Problem is that I go several times to my main activity and open one over the other every time I change from Activity.
I need to run startActivity(intent);
to pass the updated parameters, so I wanted it before I did startActivity(intent);
I would execute a method that closes the activity main before I create it again.
I researched and did not find anything about it, so I would like someone to give me an alternative to it.
appreciate!
What I wanted was to be able to do when I pressed the button to return to her and when I reached the main house, I asked if I wanted to leave!