-1

there is no error in application but when running it in android emulator I get a sorry message saying my application "has stopped unexpectedly. Please try again".I'm new in android and don't know what is wrong. Please help me.

Logcat is as follows:

06-10 16:55:38.587: D/szipinf(460): Initializing inflate state
06-10 16:55:45.569: D/szipinf(460): Initializing inflate state
06-10 16:55:48.497: D/szipinf(460): Initializing inflate state
06-10 16:55:51.207: I/dalvikvm(460): Jit: resizing JitTable from 512 to 1024
06-10 16:55:53.140: D/szipinf(460): Initializing inflate state
06-10 16:56:02.108: D/AndroidRuntime(460): Shutting down VM
06-10 16:56:02.108: W/dalvikvm(460): threadid=1: thread exiting with uncaught exception (group=0x40015560)
06-10 16:56:02.188: E/AndroidRuntime(460): FATAL EXCEPTION: main
06-10 16:56:02.188: E/AndroidRuntime(460): java.lang.RuntimeException: Unable to start activity ComponentInfo{de.uvwxy.footpath/de.uvwxy.footpath.gui.Loader}: java.lang.StringIndexOutOfBoundsException
06-10 16:56:02.188: E/AndroidRuntime(460):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
06-10 16:56:02.188: E/AndroidRuntime(460):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
06-10 16:56:02.188: E/AndroidRuntime(460):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
06-10 16:56:02.188: E/AndroidRuntime(460):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
06-10 16:56:02.188: E/AndroidRuntime(460):  at android.os.Handler.dispatchMessage(Handler.java:99)
06-10 16:56:02.188: E/AndroidRuntime(460):  at android.os.Looper.loop(Looper.java:123)
06-10 16:56:02.188: E/AndroidRuntime(460):  at android.app.ActivityThread.main(ActivityThread.java:3683)
06-10 16:56:02.188: E/AndroidRuntime(460):  at java.lang.reflect.Method.invokeNative(Native Method)
06-10 16:56:02.188: E/AndroidRuntime(460):  at java.lang.reflect.Method.invoke(Method.java:507)
06-10 16:56:02.188: E/AndroidRuntime(460):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-10 16:56:02.188: E/AndroidRuntime(460):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
06-10 16:56:02.188: E/AndroidRuntime(460):  at dalvik.system.NativeStart.main(Native Method)
06-10 16:56:02.188: E/AndroidRuntime(460): Caused by: java.lang.StringIndexOutOfBoundsException
06-10 16:56:02.188: E/AndroidRuntime(460):  at java.lang.String.substring(String.java:1651)
06-10 16:56:02.188: E/AndroidRuntime(460):  at de.uvwxy.footpath.gui.Loader.onCreate(Loader.java:231)
06-10 16:56:02.188: E/AndroidRuntime(460):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
06-10 16:56:02.188: E/AndroidRuntime(460):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
06-10 16:56:02.188: E/AndroidRuntime(460):  ... 11 more
06-10 16:56:12.558: I/Process(460): Sending signal. PID: 460 SIG: 9
4

2 回答 2

1

As you can tell by reading the stack trace, you have a StringIndexOutOfBoundsException, stemming from line 231 of your de.uvwxy.footpath.gui.Loader class, in its onCreate() method.

于 2013-06-10T18:10:58.127 回答
1

You're getting a StringIndexOutOfBoundsException in the Loader.java class at line 231. Check the substringing you're doing at that line.

于 2013-06-10T18:11:18.583 回答