What is the purpose of using moveTaskToBack() method in android?

前端 未结 3 507
不思量自难忘°
不思量自难忘° 2020-12-09 02:42

I am using moveTaskToBack() method in my activity.

When I am pressing back button the activity still is visible. The back key does not work. What did I do wrong here

3条回答
  •  無奈伤痛
    2020-12-09 02:50

    If you call super it triggers the default implementation of back button, which just finishes the current activity. Try removing the line super.onBackPressed(); and then see if the new behavior is what you expect.

提交回复
热议问题