I'm trying to access the standby bucket that my app is currently in by calling UsageStatsManager.getAppStandbyBucket()
in my activity, but the getAppStandbyBucket()
method is unresolved. The docs say that the method is public. I've ensured that my compilesdk and targetsdk are both set to 28. My buildtools are also up to date.
Edit: This is not duplicate. I needed to access the Application to be able to get the UsageStatsManager - see my answer below