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,
UPDATE
I figured out the solution. you can disable the accessibility of the first fragment before you do the fragment transaction.
rootView = inflater.inflate(R.layout.first_fragment, null, false);
rootView.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS);
and now you commit your fragment transaction. Second fragment won't leak the focus to first fragment.
Don't forget to enable the accessibility of first fragment in case you're coming back to the first fragment.
if(rootView != null) {
rootView.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
}