Know when to show a passcode lock
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 screen through the back or home button). I had it working using the following: The starting activity would call for the passcode check on startup, and each activity added the following functionality to their onPause method: @Override public void onPause() { super.onPause(); if (!isFinishing()) { new PasscodeCheckTask(this.getApplicationContext(),this).execute(); } } The PassocdeCheckTask looks like the following. It checks