I'm trying to create a lock screen that prevents access to an application when it starts but I can't find answers. I'm not sure how to implement the code. Also in most cases it's mentioned that it was deprecated in android 5.1 and higher.
(I´m working in android 7.1)
These are the links:
Android, Detect when other apps are launched