1

有没有人遇到过这个例外?我不知道它是什么。单击主页按钮并返回应用程序后,将其恢复为活动恢复。

05-31 09:17:09.224: E/AndroidRuntime(18772): FATAL EXCEPTION: main
05-31 09:17:09.224: E/AndroidRuntime(18772): java.lang.NullPointerException
05-31 09:17:09.224: E/AndroidRuntime(18772):    at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1125)
05-31 09:17:09.224: E/AndroidRuntime(18772):    at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1142)
05-31 09:17:09.224: E/AndroidRuntime(18772):    at android.os.Handler.handleCallback(Handler.java:605)
05-31 09:17:09.224: E/AndroidRuntime(18772):    at android.os.Handler.dispatchMessage(Handler.java:92)
05-31 09:17:09.224: E/AndroidRuntime(18772):    at android.os.Looper.loop(Looper.java:154)
05-31 09:17:09.224: E/AndroidRuntime(18772):    at android.app.ActivityThread.main(ActivityThread.java:4944)
05-31 09:17:09.224: E/AndroidRuntime(18772):    at java.lang.reflect.Method.invokeNative(Native Method)
05-31 09:17:09.224: E/AndroidRuntime(18772):    at java.lang.reflect.Method.invoke(Method.java:511)
05-31 09:17:09.224: E/AndroidRuntime(18772):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-31 09:17:09.224: E/AndroidRuntime(18772):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-31 09:17:09.224: E/AndroidRuntime(18772):    at dalvik.system.NativeStart.main(Native Method)
4

1 回答 1

4

当我的服务连接为空时,我遇到了这个问题:

bindService(new Intent(this, LocationService.class), lsconn, BIND_AUTO_CREATE);

lsconn变量为空(我忘了初始化它)。

高温高压

于 2013-07-27T10:08:00.977 回答