xiangxu chen
xiangxu chen

Reputation: 21

how to monitor the exting of Application?

How to monitor the exiting of Application by fullscreen slide up posture?in some mobiles the method onUserLeaveHint() doesn't invoked.So are there methods to solve?

Upvotes: 1

Views: 39

Answers (1)

Maryam Mirzaie
Maryam Mirzaie

Reputation: 596

If you use mainActivity or any other activities callbacks, you could know when the user is exiting the app.

When the user leaves the app onStop is called (your activity is not visible to the user anymore). and when activity is destroyed( app shuts down) onDestory is called.

    override fun onDestroy() {
        /* insert code here */
        super.onDestroy()
    }

for more info visit Understand the Activity Lifecycle

Upvotes: 1

Related Questions