Android Usage Access for Android 5 Samsung devices
As you might know, since Android 5 was launched, accessing the recent tasks (usage stats) of your device requires the user to enable this feature manually (Settings->Security->Usage Access). My app checks if the device uses Android 5, and if so, then it offers the user the possibility of opening the settings screen for enabling usage access: Intent intent = new Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS); startActivityForResult(intent, 12345); The problem comes when I try to do this in a Samsung device running Android 5... I got this error when the line shown above is executed: android