JakeWharton/ActionBarSherlock — Issue #317: No android:showAsAction attribute on sub-menus crashes MenuInflater
Author: yukuku
Created: 2012-02-29 08:27:16+00:00
State: open

Using post-RC1, commit 17cd662d5d10583cbfc8ec09e446ab45e498dff0
Doesn't happen on RC1.

My menu XML file is:

```

```

When I inflate it using getSupportMenuInflater(), I got the below error.

If I add showAsAction to the submenu items, it no longer crashes, for example:

```
```

Logcat when error happens:

```02-29 16:03:46.713: E/AndroidRuntime(14202): java.lang.NumberFormatException: unable to parse '@16973911' as integer
02-29 16:03:46.713: E/AndroidRuntime(14202):	at java.lang.Integer.parse(Integer.java:383)
02-29 16:03:46.713: E/AndroidRuntime(14202):	at java.lang.Integer.parseInt(Integer.java:372)
02-29 16:03:46.713: E/AndroidRuntime(14202):	at com.android.internal.util.XmlUtils.convertValueToInt(XmlUtils.java:122)
02-29 16:03:46.713: E/AndroidRuntime(14202):	at android.content.res.TypedArray.getInt(TypedArray.java:254)
02-29 16:03:46.713: E/AndroidRuntime(14202):	at com.actionbarsherlock.view.MenuInflater$MenuState.readItem(MenuInflater.java:353)
02-29 16:03:46.713: E/AndroidRuntime(14202):	at com.actionbarsherlock.view.MenuInflater.parseMenu(MenuInflater.java:146)
02-29 16:03:46.713: E/AndroidRuntime(14202):	at com.actionbarsherlock.view.MenuInflater.parseMenu(MenuInflater.java:152)
02-29 16:03:46.713: E/AndroidRuntime(14202):	at com.actionbarsherlock.view.MenuInflater.inflate(MenuInflater.java:96)
02-29 16:03:46.713: E/AndroidRuntime(14202):	at com.angelsgate.agmobile.ac.MainActivity.onCreateOptionsMenu(MainActivity.java:70)
02-29 16:03:46.713: E/AndroidRuntime(14202):	at com.actionbarsherlock.app.SherlockFragmentActivity.onCreatePanelMenu(SherlockFragmentActivity.java:225)
02-29 16:03:46.713: E/AndroidRuntime(14202):	at com.actionbarsherlock.ActionBarSherlock.callbackCreateOptionsMenu(ActionBarSherlock.java:553)
02-29 16:03:46.713: E/AndroidRuntime(14202):	at com.actionbarsherlock.internal.ActionBarSherlockCompat.preparePanel(ActionBarSherlockCompat.java:463)
02-29 16:03:46.713: E/AndroidRuntime(14202):	at com.actionbarsherlock.internal.ActionBarSherlockCompat.dispatchInvalidateOptionsMenu(ActionBarSherlockCompat.java:269)
02-29 16:03:46.713: E/AndroidRuntime(14202):	at com.actionbarsherlock.internal.ActionBarSherlockCompat$1.run(ActionBarSherlockCompat.java:968)
```

Thanks for all the good work!