Reputation: 21
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
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