Know when to show a passcode lock

前端 未结 2 575
孤独总比滥情好
孤独总比滥情好 2020-12-29 14:22

I am developing an application that needs to display a passcode screen whenever a user leaves the app and comes back (be it through a screen lock, or going back to the home

2条回答
  •  一整个雨季
    2020-12-29 14:50

    In onStop() of each activity, update a static data member with the time you left the activity. In onStart() of each activity, check that time, and if it exceeds some timeout threshold, display your authentication activity. Allow the user to set the timeout value, so that if they don't want to be bothered every few seconds, they can control that.

提交回复
热议问题