Action Bar .selectTab() and .setSelectedNavigationItem() not working
问题 I have an ActionBar with multiple tabs, each linked to a fragment. The problem I have is that when I use either bar.selectTab(Tab) or bar.setSelectedNavigationItem(int) , it doesn't work. Specifically, this problem occurs when the tabs get reduced down to a Spinner in the ActionBar. 回答1: There is a known bug with the ActionBar, specifically with the methods mentioned above and specifically when the ActionBar's tabs are reduced to a Spinner. Here's my workaround. It uses reflection to drill