I have a fragment in an activity. When the activity adds the fragment, I want to give initial accessibility focus to a view within that fragment through xml. I can do it via code, but my senior dev doesn't like it.
I tried setting :focusable
and :focusableInTouchMode
to true and <requestFocus/>
but it doesn't work.
When the activity launches and adds the fragment, nothing is focused for accessibility so :accessibilityTraversalBefore
doesn't work either.
I read this post: Set initial focus in an android application, but the solution for this doesn't work for me. Maybe because the view is in a fragment which is added dynamically.