title: Android 7.0/API24: How to check for notification access (Settings.Secure.enabled_notification_listeners)
body: <p>In Android 6.0/API23 and earlier, the following used to work:</p>
  
  <pre><code>String settingEnabled = android.provider.Settings.Secure.getString(this.getContentResolver(), "enabled_notification_listeners");
  </code></pre>
  
  <p>In Android 7.0 Nougat/API24 this seems to be no longer supported, because the code above returns <code>null</code>.</p>
  
  <p>It actually was never mentioned here: <a href="https://developer.android.com/reference/android/provider/Settings.Secure.html" rel="nofollow">https://developer.android.com/reference/android/provider/Settings.Secure.html</a></p>
  
  <p>How do we check if our app has notification access in Android 7.0 Nougat API24?</p>
  
  <p>Edit: It seems that actually that after you first gained the access in the settings, the code above returns the correct state. But not on the initial request after installation.</p>