How can I use the Android back button to move back within my app instead of closing my app?

前端 未结 4 704
迷失自我
迷失自我 2021-01-22 18:31

My app has three activities, A, B and C. I am moving from A to B through an OK button, and I want to move back from B to A by using the default back button of Android devices. W

4条回答
  •  一整个雨季
    2021-01-22 19:10

    I suspect you call finish() in your OK button onclick listener. Don't do that. finish() removes your activity from activity stack.

    Read more here.

提交回复
热议问题