This will not work if you try to run a third-party application on top of the lock screen. As you yourself have noticed, you need to set the window flag to make sure that the activity is launched on the lock screen, there is no way to guarantee that the activity of another third-party application also sets the same flag.
If you are creating a set of functions in which each function is nothing but a different application, you will need to make sure that all the entry points of this function set this window flag. It would be best to declare BaseActivity, which sets the correct flag at creation, and let the entire function development team use this as a base class for entry points.
source share