I am developing an Android application for blind communities. In my application, I process all taps / touches using a TTS / audio file.It works fine, but when a user turns on TalkBack functionality, all taps / taps are dictated twice. Firstly, this will be dictated by TalkBack, and then my internal mechanism.
I may find that 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; }
Do I want to disable the feedback function whenever my application is active?
source share