Meaning a list of all the applications that are currently open. I know you have to use Usage Stats but don't know how. All the SO answers including very recent ones are about using the ActivityManager class even though that only works on API 20 (Kitkat Watch) and lower.
Someone tried asking the same question and also pointed out that ActivityManager doesn't work and got downvoted then a mod closed the question and linked to an answer that uses, yes you guessed it, the ActivityManager class:
How to get list of all running apps programmatically