Android activity manager

后端 未结 2 868
旧巷少年郎
旧巷少年郎 2021-01-23 15:37

I guess, I have a generic logic problem. I want to logout a user after 15 if there is no activity. How do I find any \"activity\" in android. How should I go about it...

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-23 15:52

    You should have all activities inherit from a parent activity that overrides onUserInteraction(). In that callback you should reset a static app wide timer that will perform your logout code when the time reaches the end.

提交回复
热议问题