Activity is getting destroyed while pressing the home button

前端 未结 6 807
感动是毒
感动是毒 2020-12-19 03:50

In my application, when I press the home button the activity is going to onDestroy(). It suppose to be called onPause() method only right?

6条回答
  •  眼角桃花
    2020-12-19 03:54

    Of course may be memory problems, but before that check the manifest file, in the declaration of the activity, if you have "no history" declared (you don't want the activity to remain in the activity stack. Also you may using some flag when you create the activity with an intent. Then, most probable answer is the one given by Alex Contour.

提交回复
热议问题