Android应用程序在添加按钮时崩溃
大约两周前,我启动并运行了我的应用程序。除了添加两个按钮以帮助用户重新运行到主屏幕外,没有更改任何内容。但是,当我现在运行我的应用程序时,出现以下错误:Android应用程序在添加按钮时崩溃,android,fatal-error,Android,Fatal Error,大约两周前,我启动并运行了我的应用程序。除了添加两个按钮以帮助用户重新运行到主屏幕外,没有更改任何内容。但是,当我现在运行我的应用程序时,出现以下错误: 02-03 14:01:28.206 12937-12937/com.example.cherryjp.buttonapp E/AndroidRuntime: FATAL EXCEPTION: main 02-03 14:01:28.206 12937-12937/com.example.cherryjp.buttonapp E/An
02-03 14:01:28.206 12937-12937/com.example.cherryjp.buttonapp E/AndroidRuntime: FATAL EXCEPTION: main
02-03 14:01:28.206 12937-12937/com.example.cherryjp.buttonapp
E/AndroidRuntime: Process: com.example.cherryjp.buttonapp, PID: 12937
02-03 14:01:28.206 12937-12937/com.example.cherryjp.buttonapp
E/AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.cherryjp.buttonapp/com.example.cherryjp.buttonapp.ImmediateGraph}: android.content.res.Resources$NotFoundException: String resource ID #0x4
02-03 14:01:28.206 12937-12937/com.example.cherryjp.buttonapp
E/AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
以下是应用程序崩溃时的名称:
public void showGraph(Entry entry){
Intent immediateGraphIntent = new Intent(this, ImmediateGraph.class);
final int result = 1;
//Just getEntry on next intent instead of storing extras.
immediateGraphIntent.putExtra("ENTRY_ID", entry.getId());
//immediateGraphIntent.putExtra("PASSTIME", timeArray);
//immediateGraphIntent.putExtra("PASSFORCE", forceArray);
startActivity(immediateGraphIntent);
}
该错误的重要部分是
NotFoundException:String resource ID#0x4
post您的onCreate或您使用字符串资源IDPostonCreate()
方法的ImmediateGraph
活动。