How to Properly Create A Password Activity for an Android App Locker?


I am building an app locker for Android using AccessibilityService. I have implemented the app detection part but am stuck at the password screen part.

My questions are:

  1. How do I show the password activity without launching the MainActivity?
  2. How can I hide the password activity from the Recents screen?
  3. How can I hide the content of the locked apps in the Recents screen (e.g. turning them to blank)?

Thank you.

Source: Android Questions