No, at least not reliably.
Google has always stated that you should not do this. As of Lollipop, they are actively trying to prevent it. ActivityManager#getRunningTasks(...)
was changed in Android 5.0 so it only returns information about the app calling it. So people started using ActivityManager#getRunningAppProcesses(...)
, but this was similarly restricted in Android 5.1.1 and 6.0.
The only sanctioned way to obtain information about other running apps is through the Usage Stats API. But that API requires a permission that can only be granted interactively through a system activity, not in the app's manifest. And the documentation states that the system activity may not be present on all devices. Manufacturers that have removed it from at least some of their devices include Samsung and LG.
Basically, barring the discovery of some new hack, third-party app lockers are history as of Android 6.