无法恢复活动运行时异常

时间:2018-07-11 12:51:18

标签: java android

任何想法都是什么错误,您还希望我上传什么来解决此问题。

 java.lang.RuntimeException: Unable to resume activity {com.wolframite.manos.crack_the_code/com.wolframite.manos.crack_the_code.single_player}: android.content.res.Resources$NotFoundException: String resource ID #0x1
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3493)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3533)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1584)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:163)
at android.app.ActivityThread.main(ActivityThread.java:6342)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:880)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:770)
Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x1
at android.content.res.Resources.getText(Resources.java:347)
at android.content.res.MiuiResources.getText(MiuiResources.java:97)
at android.widget.TextView.setText(TextView.java:4557)
at com.wolframite.manos.crack_the_code.single_player.onResume(single_player.java:736)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1270)
at android.app.Activity.performResume(Activity.java:6960)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3470)
... 8 more

1 个答案:

答案 0 :(得分:1)

您不能在setText(String)方法中设置整数值,

尝试使用..(在“活动”的Integer中)将String转换为onResume()

setText(Integer.toString(intValue))