6

I am developing an android app for the blind community.In my application, I am handling all taps/touches with TTS/audio file.It works fine, but when user turns on TalkBack functionality all taps/touches are dictated twice. First, it will dictate by TalkBack and then my internal mechanism.

I am able to detect TalkBack is enabled or not.

    public boolean accessibilityEnable(Context context) {
        boolean enable = false;
        Log.e("Reached before function", "yes");
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
            try {
                AccessibilityManager manager = (AccessibilityManager) context.getSystemService(Context.ACCESSIBILITY_SERVICE);
                List<AccessibilityServiceInfo> serviceList = manager.getEnabledAccessibilityServiceList(AccessibilityServiceInfo.FEEDBACK_SPOKEN);
                Log.e("Reached before for loop", "yes");
                for (AccessibilityServiceInfo serviceInfo : serviceList) {
                    String name = serviceInfo.getSettingsActivityName();

                    if (!TextUtils.isEmpty(name) && name.equals(TALKBACK_SETTING_ACTIVITY_NAME)) {
                        enable = true;
                        Log.e("Reached after if loop", "yes");
                    }
                }
                Log.e("Reached after for loop", "yes");
            } catch (Exception e) {
                Log.e("Error", "Error aaya re");
            }
        }
        return enable;
    }

I want to disable talkback functionality whenever my app is active?

Maaz Patel
  • 756
  • 2
  • 7
  • 20
  • http://stackoverflow.com/questions/8091350/how-to-find-the-currently-running-applications-programatically-in-android – rohitanand Feb 16 '17 at 06:10
  • 1
    Possible duplicate of [Disabling talkback for specific application](http://stackoverflow.com/questions/5778315/disabling-talkback-for-specific-application) – Moshe Katz Feb 22 '17 at 17:16
  • 1
    The answer given in that link is not relevant to my question. – Maaz Patel Mar 06 '17 at 11:29

0 Answers0