Detect if my accessibility service is enabled

I was wondering how could I detect if my own service is enabled. So I could check if my service is not enabled, then tell the user to enable it.


  • Programming for Android as a blind person
  • How to know if Android TalkBack is active?
  • Making Android apps accessible (for people with disabilities) with PhoneGap
  • Detect if “Large Text” accessibility option is enabled on Android
  • How to start AccessibilityService?
  • 'Missing contentDescription attribute on image' in XML
  • How to access html content of AccessibilityNodeInfo of a WebView element using Accessibility Service in Android?
  • AccessibilityService is started but does not receive AccessibilityEvents on JellyBean
  • Accessibility function implementation problems in Android
  • 'Missing contentDescription attribute on image' in XML
  • How to start AccessibilityService?
  • How to Programmatically Enable/Disable Accessibility Service in Android
  • One Solution collect form web for “Detect if my accessibility service is enabled”

    Below is the method to check if your accessibility service is enabled or not. 

    Note: Change value of YOURAccessibilityService with your Service. 

    // To check if service is enabled
    private boolean isAccessibilitySettingsOn(Context mContext) {
        int accessibilityEnabled = 0;
        final String service = getPackageName() + "/" + YOURAccessibilityService.class.getCanonicalName();
        try {
            accessibilityEnabled = Settings.Secure.getInt(
            Log.v(TAG, "accessibilityEnabled = " + accessibilityEnabled);
        } catch (Settings.SettingNotFoundException e) {
            Log.e(TAG, "Error finding setting, default accessibility to not found: "
                    + e.getMessage());
        TextUtils.SimpleStringSplitter mStringColonSplitter = new TextUtils.SimpleStringSplitter(':');
        if (accessibilityEnabled == 1) {
            Log.v(TAG, "***ACCESSIBILITY IS ENABLED*** -----------------");
            String settingValue = Settings.Secure.getString(
            if (settingValue != null) {
                while (mStringColonSplitter.hasNext()) {
                    String accessibilityService =;
                    Log.v(TAG, "-------------- > accessibilityService :: " + accessibilityService + " " + service);
                    if (accessibilityService.equalsIgnoreCase(service)) {
                        Log.v(TAG, "We've found the correct setting - accessibility is switched on!");
                        return true;
        } else {
            Log.v(TAG, "***ACCESSIBILITY IS DISABLED***");
        return false;

    And to call this method:

    if (!isAccessibilitySettingsOn(getApplicationContext())) {
        startActivity(new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS));

    This will check and launch accessibility settings if not enabled.

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.