androidandroid-activityondestroy

Activity is getting destroyed while pressing the home button


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

Why it is happening so?


Solution

  • It depends on how much memory your phone has, if your phone does not have very much memory, then it will destroy the activity to free up resources immediately. On new phones, this will not happen because they have plenty of spare memory.