Reputation: 1018
I'm trying to get the application usage list in android lollipop using UsageStatsManager, for that I have gone through the android developer document https://developer.android.com/reference/android/app/usage/UsageStatsManager.html I don't know how to use UsageStasManger, so I referred few links How to get list of recent apps with Android API 21 Lollipop? Android Lollipop know if app as Usage Stats access and implement in my project but I didn't get any data from UsageStausManager? how do I Use UsageStausManager in my project. Anyone help me out.
Upvotes: 0
Views: 1825
Reputation: 4251
From lollipop we will not be able to use the activity manager for determining the current foreground tasks. we have to make use of the Usage Stats Manager. Wrote a small code and answered in this thread
Determining the current foreground application from a background task or service
You can have a look at this thread by me.
Upvotes: 1