How do I detect if the user has left my app?

后端 未结 6 1039
情话喂你
情话喂你 2020-12-02 15:36

I am developing an Android app and I want to detect when the user exits my app either by clicking the Back button or the Home button.

Also, an event like onIn

6条回答
  •  孤街浪徒
    2020-12-02 16:15

    Yes, check the lifecycle of the app - when a user minimizes or leaves a couple of methods get called onPause() onStop() and onDestroy()

    http://developer.android.com/reference/android/app/Activity.html

提交回复
热议问题