开发者

How to create Back button using task stack in android?

开发者 https://www.devze.com 2023-03-16 23:39 出处:网络
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开发者_StackOverf

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

精彩评论

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