I would like to try the android.app.usage API's in my application to know the kind of result we can expect from it. But there are no efficient documentation on this to use it. Specifically I'm looking forward to use UsageEvents.Event, UsageStats and UsageStatsManager API's. I searched thoroughly and I could only find this one link as a reference.
I tried the code given in the above link but I'm getting an empty list as the result. I've given the permission and also I'm enabling the UsageStats setting under Security section. Any reference on how to use this will be very helpful.
Note - I've tried to run the above code in Nexus 5 running on Lollipop. I did not get the result.