My application uses tabs with swipe navigation defined in developer.google.com where I am using the FragmentPagerAdapter.
When trying to make sure my application is accessible, I came across the following problem:
When the application is started, the onCreateView(...) of the 1st fragment is called, followed by those of the 2nd and 3rd fragments. As a consequence of this, the third tab's title has focus when the application starts and is read out even though the first tab is currently visible to the user and it's title should be read out.
While swiping through the tabs, the tab titles are read out correctly, depending on which tab is currently visible to the user.
Is there any way to fix this so that on startup, the first tab title has focus and is read out.
P.S. I tried fixing this by sending an accessibility event from the first fragment's setUserVisibleHint(...) method but this doesn't work, at least on android 4.4. The accessibility event I am sending is a call to one of the 1st fragment's textview's sendAccessibilityEvent function. Again, to clarify, the issue is not with the accessibility event, this works just fine while the application is running and I am swiping between tabs. The issue is that on startup, app focus is not on the currently displayed fragment but is instead on the fragment whose onCreateView() was called last.