https://kotlinlang.org logo
Title
u

user

06/26/2022, 1:11 AM
Android - queryAndAggregateUsageStats returns empty map I am working on a requirement where I need to get the app usage every 15 mins. I am getting empty map. Please see below code. I guess INTERVAL_BEST interval type is not working for given timeframe. Any help will be appreciated. Thanks. fun getAppsUsageMap() { val manager: UsageStatsManager? = null val calendar = Calendar.getInstance() val startTime = calendar.timeInMillis; calendar.add(Calendar.MINUTE, -15) val endTime = calendar.timeInMillis;...