Android TalkBack and fragment stack

前端 未结 6 1785
迷失自我
迷失自我 2021-01-11 17:14

For an application that I work on, I need to implement accessibility. Everything works fine except for one screen where I have to fragments added to my activity. Basically,

6条回答
  •  南笙
    南笙 (楼主)
    2021-01-11 17:57

    Adding

    view.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);`
    view.performAccessibilityAction(AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS, null);
    

    inside onResume

    and adding

    view.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS);
    

    inside onPause works for me.

提交回复
热议问题