Android app start and end event

后端 未结 5 1030

I have an app which track user activity on app which include time etc, Now if user has opened the app, It will start an session and till user in this app , his session will cont

5条回答
  •  Happy的楠姐
    2021-02-05 22:34

    You need to look into Activity lifecycles on Android.

    What you need is onPause - see the documentation here

    I would also mention that onPause is fired even when switching between multiple activities, so you'd need to track when it's pausing to go to another screen.

提交回复
热议问题