0

我的应用程序在模拟器中正确运行但是当我尝试在设备中运行时。我不会给我错误

请尝试解决这个问题

07-10 02:56:34.022: D/AndroidRuntime(28052): Shutting down VM
07-10 02:56:34.022: W/dalvikvm(28052): threadid=1: thread exiting with uncaught exception (group=0x40a551f8)
07-10 02:56:34.022: E/AndroidRuntime(28052): FATAL EXCEPTION: main
07-10 02:56:34.022: E/AndroidRuntime(28052): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.mobileTimerClock/com.android.mobileTimerClock.TimeClockDashBoard}: java.lang.NullPointerException: println needs a message
07-10 02:56:34.022: E/AndroidRuntime(28052):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
07-10 02:56:34.022: E/AndroidRuntime(28052):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
07-10 02:56:34.022: E/AndroidRuntime(28052):    at android.app.ActivityThread.access$600(ActivityThread.java:123)
07-10 02:56:34.022: E/AndroidRuntime(28052):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
07-10 02:56:34.022: E/AndroidRuntime(28052):    at android.os.Handler.dispatchMessage(Handler.java:99)
07-10 02:56:34.022: E/AndroidRuntime(28052):    at android.os.Looper.loop(Looper.java:137)
07-10 02:56:34.022: E/AndroidRuntime(28052):    at android.app.ActivityThread.main(ActivityThread.java:4424)
07-10 02:56:34.022: E/AndroidRuntime(28052):    at java.lang.reflect.Method.invokeNative(Native Method)
07-10 02:56:34.022: E/AndroidRuntime(28052):    at java.lang.reflect.Method.invoke(Method.java:511)
07-10 02:56:34.022: E/AndroidRuntime(28052):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
07-10 02:56:34.022: E/AndroidRuntime(28052):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
07-10 02:56:34.022: E/AndroidRuntime(28052):    at dalvik.system.NativeStart.main(Native Method)
07-10 02:56:34.022: E/AndroidRuntime(28052): Caused by: java.lang.NullPointerException: println needs a message
07-10 02:56:34.022: E/AndroidRuntime(28052):    at android.util.Log.println_native(Native Method)
07-10 02:56:34.022: E/AndroidRuntime(28052):    at android.util.Log.i(Log.java:159)
07-10 02:56:34.022: E/AndroidRuntime(28052):    at com.android.mobileTimerClock.TimeClockDashBoard.onCreate(TimeClockDashBoard.java:394)
07-10 02:56:34.022: E/AndroidRuntime(28052):    at android.app.Activity.performCreate(Activity.java:4465)
07-10 02:56:34.022: E/AndroidRuntime(28052):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
07-10 02:56:34.022: E/AndroidRuntime(28052):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
07-10 02:56:34.022: E/AndroidRuntime(28052):    ... 11 more
07-10 02:56:34.022: W/ActivityManager(177):   Force finishing activity com.android.mobileTimerClock/.TimeClockDashBoard
07-10 02:56:34.030: W/ActivityManager(177):   Force finishing activity com.android.mobileTimerClock/.DashBoard
07-10 02:56:34.530: W/ActivityManager(177): Activity pause timeout for ActivityRecord{41d0a690 com.android.mobileTimerClock/.TimeClockDashBoard}
4

1 回答 1

2

我的猜测是您将 null 作为第二个参数传递给Log.i(String, String)调用(或类似Log.*()方法):

java.lang.NullPointerException: println needs a message
于 2012-07-10T16:34:08.863 回答