Scherlock action bar does not update when orientation changes

I use the Sherlock action bar in my application. I used the ifRoom | withText function in my menu. If I check my code in portrait mode, I can only see the icon, and if I rotate the orientation to landscape, I can only see the icon. On the other hand, if I run with the landscape, I can see the text and the icon on the portrait and landscape. This means that when you rotate the screen, the action bar does not update. How can i fix it?

I have a menu

    android:showAsAction="ifRoom|withText"

I also used this line in the manifest file to fix

    android:configChanges="keyboardHidden|orientation|screenSize"

but it didn’t work. And I run my Android 2.3 code

I also used a fragment in my work,

        FragmentManager fm = getSupportFragmentManager();
    ft = fm.beginTransaction();

    mFragment1 = fm.findFragmentByTag("f1");

    if (mFragment1 == null) {

        mFragment1 = new MenuFragment();
        ft.add(mFragment1, "f1");

    }

    ft.commit();
+5
source share
2

ActionBarSherlock.

pre-ICS ActionBarSherlock , , , , , . , , .

Android . , ActionBarSherlock.

- , .

+6

, ActionBar

invalidateOptionsMenu();
0

All Articles