Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/205.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android应用程序在添加按钮时崩溃_Android_Fatal Error - Fatal编程技术网

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或您使用字符串资源IDPost
onCreate()
方法的
ImmediateGraph
活动。