android.content.res.Resources$NotFoundException: String resource ID #0x0

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/hello_zhou/article/details/61919528
错误提示:

 Android.content.res.Resources$NotFoundException: String resource ID #0x0

错误原因:

在setText()中使用了int型的参数

错误解决方法:

setText()把整型转换成string类型,方法如下:

1.String s=String.valueOf(i);

2.String s=Integer.toString(i);

3.Striing s=""+i;
阅读更多

android.content.res.Resources$NotFoundException: Resource ID #0x0

09-14

在网上搜索各种相似的解决方法,但是都没用,在引用第三方jar包的时候抱这种错误,android.content.res.Resources$NotFoundException: Resource ID #0x0rnE/AndroidRuntime( 1387): at android.content.res.Resources.getValue(Resources.java:1123)rnE/AndroidRuntime( 1387): at android.content.res.Resources.loadXmlResourceParser(Resources.java:2309)rnE/AndroidRuntime( 1387): at android.content.res.Resources.getLayout(Resources.java:939)rnE/AndroidRuntime( 1387): at android.view.LayoutInflater.inflate(LayoutInflater.java:395)rnE/AndroidRuntime( 1387): at android.view.LayoutInflater.inflate(LayoutInflater.java:353)rnE/AndroidRuntime( 1387): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:290)rnE/AndroidRuntime( 1387): at android.app.Activity.setContentView(Activity.java:1956)rnE/AndroidRuntime( 1387): at com.jxmfkj.gamecenter.aidl.MainActivity.a(MainActivity.java:201)rnE/AndroidRuntime( 1387): at com.jxmfkj.gamecenter.aidl.MainActivity.a(MainActivity.java:143)rnE/AndroidRuntime( 1387): at com.jxmfkj.gamecenter.aidl.k.handleMessage(MainActivity.java:364)rnE/AndroidRuntime( 1387): at android.os.Handler.dispatchMessage(Handler.java:102)rnE/AndroidRuntime( 1387): at android.os.Looper.loop(Looper.java:136)rnE/AndroidRuntime( 1387): at android.app.ActivityThread.main(ActivityThread.java:5017)rnE/AndroidRuntime( 1387): at java.lang.reflect.Method.invokeNative(Native Method)rnE/AndroidRuntime( 1387): at java.lang.reflect.Method.invoke(Method.java:515)rnE/AndroidRuntime( 1387): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:828)rnE/AndroidRuntime( 1387): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:644)rnE/AndroidRuntime( 1387): at dalvik.system.NativeStart.main(Native Method)rnW/ActivityManager( 583): Force finishing activity com.izhangxin.nn.android/com.jxmfkj.gamecenter.aidl.MainActivityrnI/ActivityManager( 583): Process com.izhangxin.nn.android (pid 1387) has died.rn这是全部的报错,求大神提供解决思路。

android.content.res.Resources$NotFoundException: Resource ID #0x7f080000

04-28

04-28 09:34:51.591: E/AndroidRuntime(1849): FATAL EXCEPTION: mainrn04-28 09:34:51.591: E/AndroidRuntime(1849): Process: com.example.project, PID: 1849rn04-28 09:34:51.591: E/AndroidRuntime(1849): android.content.res.Resources$NotFoundException: Resource ID #0x7f080000rn04-28 09:34:51.591: E/AndroidRuntime(1849): at android.content.res.Resources.getValue(Resources.java:1123)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at android.content.res.Resources.loadXmlResourceParser(Resources.java:2309)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at android.content.res.Resources.getLayout(Resources.java:939)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at android.view.MenuInflater.inflate(MenuInflater.java:107)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at com.google.simpleframe.core.BaseActivity.onCreateOptionsMenu(BaseActivity.java:93)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at android.app.Activity.onCreatePanelMenu(Activity.java:2538)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:436)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at com.android.internal.policy.impl.PhoneWindow.onKeyDownPanel(PhoneWindow.java:820)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at com.android.internal.policy.impl.PhoneWindow.onKeyDown(PhoneWindow.java:1568)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1969)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:3852)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:3826)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3399)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3449)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3418)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3525)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3426)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3582)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3399)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3449)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3418)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3426)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3399)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3449)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3418)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3558)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:3718)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:2010)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:1704)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:1695)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:1987)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:141)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at android.os.MessageQueue.nativePollOnce(Native Method)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at android.os.MessageQueue.next(MessageQueue.java:138)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at android.os.Looper.loop(Looper.java:123)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at android.app.ActivityThread.main(ActivityThread.java:5017)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at java.lang.reflect.Method.invokeNative(Native Method)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at java.lang.reflect.Method.invoke(Method.java:515)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)rn04-28 09:34:51.591: E/AndroidRuntime(1849): at dalvik.system.NativeStart.main(Native Method)rnrnrn我的工程里加了扫码功能后, 点击menu程序就崩溃了。好像是资源的事,谁能帮我解决一下?!求求了rnrn04-28 09:34:51.591: E/AndroidRuntime(1849): android.content.res.Resources$NotFoundException: Resource ID #0x7f080000rn我仔细看了一下,我的menu的R.id的确是#0x7f080000,xml文件也存在。

没有更多推荐了,返回首页