“不幸的是myapp已经停止了”

时间:2016-04-30 20:34:13

标签: java android android-studio

这就是logcat所说的

E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.NullPointerException                   at org.json.JSONTokener.nextCleanInternal(JSONTokener.java:116)
                                                 at org.json.JSONTokener.nextValue(JSONTokener.java:94)
                                                 at org.json.JSONObject.<init>(JSONObject.java:154)
                                                 at org.json.JSONObject.<init>(JSONObject.java:171)
                                                 at com.example.nadreen.loginapp.BackgroundTask.onPostExecute(BackgroundTask.java:169)
                                                 at com.example.nadreen.loginapp.BackgroundTask.onPostExecute(BackgroundTask.java:35)
                                                 at android.os.AsyncTask.finish(AsyncTask.java:631)
                                                 at android.os.AsyncTask.access$600(AsyncTask.java:177)
                                                 at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)
                                                 at android.os.Handler.dispatchMessage(Handler.java:99)
                                                 at android.os.Looper.loop(Looper.java:137)
                                                 at android.app.ActivityThread.main(ActivityThread.java:5041)
                                                 at java.lang.reflect.Method.invokeNative(Native Method)
                                                 at java.lang.reflect.Method.invoke(Method.java:511)
                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
                                                 at dalvik.system.NativeStart.main(Native Method)

这是按下带下划线的部分时导航进入的代码区域

public class BackgroundTask extends AsyncTask<String,Void,String>{
String register_url="localhost:8080/loginapp/register.php";
String login_url="localhost:8080/loginapp/login.php";
Context ctx;
ProgressDialog progressDialog;
Activity activity;
AlertDialog.Builder builder;

0 个答案:

没有答案