Skip to content
This repository has been archived by the owner on Apr 19, 2018. It is now read-only.

Error inflating class when using showAsAction on 2.3 #1111

Closed
andytriboletti opened this issue Sep 23, 2014 · 1 comment
Closed

Error inflating class when using showAsAction on 2.3 #1111

andytriboletti opened this issue Sep 23, 2014 · 1 comment

Comments

@andytriboletti
Copy link

I'm using ActionBarSherlock in my project and I updated to the latest version. I'm trying to make the app work with Android version 2.3. Here's the xml for one of my menu files:

<item
    android:id="@+id/search_menu_item"
    android:actionLayout="@layout/conversation_name"
    android:icon="@drawable/ic_action_about"
    android:showAsAction="always|withText|collapseActionView"
    android:title="(1)"/>

The error I get is 09-23 15:08:30.143: E/AndroidRuntime(3384): FATAL EXCEPTION: main
09-23 15:08:30.143: E/AndroidRuntime(3384): android.view.InflateException: Binary XML file line #7: Error inflating class

Line #7 is showAsAction.

I tried using a custom namespace 'yourapp' and doing yourapp:showAsAction but then the app wouldn't compile.

@andytriboletti
Copy link
Author

Nevermind this wasn't the issue. I calling invalidateMenuOptions in onCreateOptionsMenu and it was working in 4.x but not 2.3. I changed it to use onPrepareOptionsMenu and it's working fine now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant