03-06 10:24:10.285: E/AndroidRuntime(28712): FATAL EXCEPTION: main
03-06 10:24:10.285: E/AndroidRuntime(28712): **android.content.res.Resources$NotFoundException: Resource ID #0x1090046**
03-06 10:24:10.285: E/AndroidRuntime(28712): at android.content.res.Resources.getValue(Resources.java:1019)
03-06 10:24:10.285: E/AndroidRuntime(28712): at android.content.res.Resources.loadXmlResourceParser(Resources.java:2107)
03-06 10:24:10.285: E/AndroidRuntime(28712): at android.content.res.Resources.getLayout(Resources.java:858)
03-06 10:24:10.285: E/AndroidRuntime(28712): at android.view.LayoutInflater.inflate(LayoutInflater.java:394)
03-06 10:24:10.285: E/AndroidRuntime(28712): at com.android.internal.view.menu.BaseMenuPresenter.getMenuView(BaseMenuPresenter.java:70)
03-06 10:24:10.285: E/AndroidRuntime(28712): at com.android.internal.policy.impl.PhoneWindow$PanelFeatureState.getIconMenuView(PhoneWindow.java:3484)
03-06 10:24:10.285: E/AndroidRuntime(28712): at com.android.internal.policy.impl.PhoneWindow.initializePanelContent(PhoneWindow.java:1124)
03-06 10:24:10.285: E/AndroidRuntime(28712): at com.android.internal.policy.impl.PhoneWindow.openPanel(PhoneWindow.java:579)
03-06 10:24:10.285: E/AndroidRuntime(28712): at com.android.internal.policy.impl.PhoneWindow.onKeyUpPanel(PhoneWindow.java:845)
03-06 10:24:10.285: E/AndroidRuntime(28712): at com.android.internal.policy.impl.PhoneWindow.onKeyUp(PhoneWindow.java:1637)
03-06 10:24:10.285: E/AndroidRuntime(28712): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1964)
03-06 10:24:10.285: E/AndroidRuntime(28712): at android.view.ViewRootImpl.deliverKeyEventPostIme(ViewRootImpl.java:3546)
03-06 10:24:10.285: E/AndroidRuntime(28712): at android.view.ViewRootImpl.handleFinishedEvent(ViewRootImpl.java:3519)
03-06 10:24:10.285: E/AndroidRuntime(28712): at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2603)
03-06 10:24:10.285: E/AndroidRuntime(28712): at android.os.Handler.dispatchMessage(Handler.java:99)
03-06 10:24:10.285: E/AndroidRuntime(28712): at android.os.Looper.loop(Looper.java:137)
03-06 10:24:10.285: E/AndroidRuntime(28712): at android.app.ActivityThread.main(ActivityThread.java:4507)
03-06 10:24:10.285: E/AndroidRuntime(28712): at java.lang.reflect.Method.invokeNative(Native Method)
03-06 10:24:10.285: E/AndroidRuntime(28712): at java.lang.reflect.Method.invoke(Method.java:511)
03-06 10:24:10.285: E/AndroidRuntime(28712): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
03-06 10:24:10.285: E/AndroidRuntime(28712): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
03-06 10:24:10.285: E/AndroidRuntime(28712): at dalvik.system.NativeStart.main(Native Method)
很多人说,你必须清理项目或刷新生成的数据, 但它仍然无效。 我尝试在许多设备上调试我的应用程序,它具有完全不同的Android版本。 例如,它可以在2.2的旧设备上运行,但在我的手机上没有4.0.3(Galaxy S2)。
这是java类:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate( R.menu.main_options_menu, menu);
return super.onCreateOptionsMenu(menu);
}
这是菜单项的xml:
<menu xmlns:android="https://schemas.android.com/apk/res/android">
<item
android:id="@+id/about"
android:title="@string/menu_item_about"
android:icon="@drawable/ueber"/>
**<!--I don't list all the items!-->**
<!-- I'm sure, that all of the Resources are in the folders. The Strings are correct, the drawable, too.-->
</menu>
请帮帮我