我有問題了解我的Logcat中的錯誤,請問我可以幫我解決這個問題。我的Logcat中的這個錯誤是什麼意思
04-06 08:17:54.738: E/AndroidRuntime(4491): FATAL EXCEPTION: AsyncTask #1
04-06 08:17:54.738: E/AndroidRuntime(4491): java.lang.RuntimeException: An error occured while executing doInBackground()
04-06 08:17:54.738: E/AndroidRuntime(4491): at android.os.AsyncTask$3.done(AsyncTask.java:299)
04-06 08:17:54.738: E/AndroidRuntime(4491): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
04-06 08:17:54.738: E/AndroidRuntime(4491): at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
04-06 08:17:54.738: E/AndroidRuntime(4491): at java.util.concurrent.FutureTask.run(FutureTask.java:239)
04-06 08:17:54.738: E/AndroidRuntime(4491): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
04-06 08:17:54.738: E/AndroidRuntime(4491): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
04-06 08:17:54.738: E/AndroidRuntime(4491): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
04-06 08:17:54.738: E/AndroidRuntime(4491): at java.lang.Thread.run(Thread.java:841)
04-06 08:17:54.738: E/AndroidRuntime(4491): Caused by: java.lang.NullPointerException: println needs a message
04-06 08:17:54.738: E/AndroidRuntime(4491): at android.util.Log.println_native(Native Method)
04-06 08:17:54.738: E/AndroidRuntime(4491): at android.util.Log.e(Log.java:231)
04-06 08:17:54.738: E/AndroidRuntime(4491): at com.example.logintest.adduser$AssCrounTask.doInBackground(adduser.java:118)
04-06 08:17:54.738: E/AndroidRuntime(4491): at com.example.logintest.adduser$AssCrounTask.doInBackground(adduser.java:1)
04-06 08:17:54.738: E/AndroidRuntime(4491): at android.os.AsyncTask$2.call(AsyncTask.java:287)
04-06 08:17:54.738: E/AndroidRuntime(4491): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
04-06 08:17:54.738: E/AndroidRuntime(4491): ... 4 more
printStacktrace()是什麼?我認爲它會報告錯誤 – mathiascolebar
是的,但在控制檯應用程序中,它可以在Android中確定它不是。這將是太長的評論,所以我找到了你的答案:http://stackoverflow.com/questions/7469316/why-is-exception-printstacktrace-considered-bad-practice –