possible duplicate of How to close activity and go back to previous activity in android
The problem is, I add finish() at the end of the method I'm currently on, and the whole app closes.
I want it to return back to the previous screen by pressing the back button on the phone (I don't want to add a back button in the app)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void secondScreen(View v) {
setContentView(R.layout.activity_second_screen);
}
I want to return to main from secondScreen()