I am currently backporting my application to make it work on device prior to 3.0 using actionbarsherlock.
If a user launches the application in portrait mode and then rotates the screen and tries to select a tab nothing happens until the user preforms another action. The current build which does this can be downloaded here (sherlock-alpha1) http://tinyurl.com/cz95nup.
Tabs are added in the following way
bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
bar.addTab(bar.newTab().setText("tab1").setTabListener(this),false);
bar.addTab(bar.newTab().setText("tab2").setTabListener(this),false);
bar.addTab(bar.newTab().setText("tab3").setTabListener(this),false);
This also occurs if you launch the application in landscape and then use it in portrait mode (portrait tabs will not work).
It is working fine on devices running the native actionbar.
Are you handling configuration changes in the manifest?
android:configChanges="orientation"
If so this is not allowing the fake decor view that ActionBarSherlock installs to be re-initialized on rotation which will cause many problems.
Handling configuration changes should be used as sparingly as possible. The documentation states that it should be used as a last resort.
Future versions of the library will hopefully be able to account for people who choose to do this.
For me it was unresponsive after orientation changes, not in landscape mode. After a lot of trial and errors I've found the following solution for this bug:
@Override
public void onConfigurationChanged(Configuration newConfig) {
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
super.onConfigurationChanged(newConfig);
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
}
The trick is to change the navigation mode to list then change back to tabs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With