Actionbar scherlock is not refreshed when the orientation is changed

Posted by SavasCinar on Stack Overflow See other posts from Stack Overflow or by SavasCinar
Published on 2012-05-14T19:16:32Z Indexed on 2012/09/07 9:38 UTC
Read the original article Hit count: 232

I use Sherlock action bar in my application. I used "ifRoom|withText" feature in my menu. If I test my code in portrait mode, I can see only icon and if I rotate orientation to landscape, still I see only icon. On the other hand, if I run with landscape, I can see text and icon on portrait and landscape. This means that When the screen is rotated, action bar is not refreshed. How can I fix?

In menu, I have

    android:showAsAction="ifRoom|withText"

Also I used this line in my manifest file to fixed

    android:configChanges="keyboardHidden|orientation|screenSize"

but it didn't work. And I run my code android 2.3

Also I used fragment in my activity,

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

    mFragment1 = fm.findFragmentByTag("f1");

    if (mFragment1 == null) {

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

    }

    ft.commit();

© Stack Overflow or respective owner

Related posts about android

Related posts about android-actionbar