Ready for a crazy one (android par for the course).
Only with Ice Cream Sandwich, somewhere in onPreparedOptionsMenu (or onCreateOptionsMenu) getting this nasty crash below.
My code? Simple. I've tried the commons apps, and a brand new app which all WORK,however, my app is doing something that ICS doesn't like, but I can't figure out what. The code is so simple:
@Override
public boolean onPrepareOptionsMenu(final Menu menu){
// comment menu.add out and no exception
menu.add(0,0,0,"Add");
return super.onPrepareOptionsMenu(menu);
}
More exciting/fun. IF I rotate the device and back again (or just rotate), IT WORKS. Something in the intial setup/launch of the app appears to be wrong. I've tested this in every emulator up to 4.0.3 and they ALL WORK , except 4.x.
/AndroidRuntime( 2406): FATAL EXCEPTION: main
E/AndroidRuntime( 2406): android.content.res.Resources$NotFoundException: Resource ID #0x1090045
E/AndroidRuntime( 2406): at android.content.res.Resources.getValue(Resources.java:1019)
E/AndroidRuntime( 2406): at android.content.res.Resources.loadXmlResourceParser(Resources.java:2107)
E/AndroidRuntime( 2406): at android.content.res.Resources.getLayout(Resources.java:858)
E/AndroidRuntime( 2406): at android.view.LayoutInflater.inflate(LayoutInflater.java:394)
E/AndroidRuntime( 2406): at com.android.internal.view.menu.BaseMenuPresenter.getMenuView(BaseMenuPresenter.java:70)
E/AndroidRuntime( 2406): at com.android.internal.policy.impl.PhoneWindow$PanelFeatureState.getIconMenuView(PhoneWindow.java:3320)
E/AndroidRuntime( 2406): at com.android.internal.policy.impl.PhoneWindow.initializePanelContent(PhoneWindow.java:1096)
E/AndroidRuntime( 2406): at com.android.internal.policy.impl.PhoneWindow.openPanel(PhoneWindow.java:559)
E/AndroidRuntime( 2406): at com.android.internal.policy.impl.PhoneWindow.onKeyUpPanel(PhoneWindow.java:817)
E/AndroidRuntime( 2406): at com.android.internal.policy.impl.PhoneWindow.onKeyUp(PhoneWindow.java:1486)
E/AndroidRuntime( 2406): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1813)
E/AndroidRuntime( 2406): at android.view.ViewRootImpl.deliverKeyEventPostIme(ViewRootImpl.java:3327)
E/AndroidRuntime( 2406): at android.view.ViewRootImpl.handleFinishedEvent(ViewRootImpl.java:3300)
E/AndroidRuntime( 2406): at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2460)
E/AndroidRuntime( 2406): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 2406): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 2406): at android.app.ActivityThread.main(ActivityThread.java:4424)
E/AndroidRuntime( 2406): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 2406): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime( 2406): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
E/AndroidRuntime( 2406): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
E/AndroidRuntime( 2406): at dalvik.system.NativeStart.main(Native Method)