开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜