How to create Back button using task stack in android?
I want to add "Back" button to my activity
to be able to reopen the previous activity, I read that task stack
keeps all the previously opened activities m how can I start the latest开发者_StackOverflow中文版 opened activity when clicking my "Back" button ?
Imitating the back button:
Button myBackButton = (Button) findViewById(R.id.back_button);
myBackButton.setOnClickListener(new View.OnClickListener(
@Override
public void onClick(){
finish();
}
));
finish(); API
精彩评论