0

this is what the logcat says

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)

and this is the area of the code that the navigation goes to when pressing the underlined part

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;
nadreen
  • 47
  • 6
  • 3
    Possible duplicate of [What is a Null Pointer Exception, and how do I fix it?](http://stackoverflow.com/questions/218384/what-is-a-null-pointer-exception-and-how-do-i-fix-it) – Jesse Buss Apr 30 '16 at 20:36
  • 1
    For s to help you we need to see more code. Specifically what relates around BackgroundTak onPostExecute method. – Henrik Gyllensvärd Apr 30 '16 at 20:41
  • 1
    in BackgroundTask.java on row 169 you are using an object which is `null`, means it doesn't exist / not initialized etc. you've probably posted the code in the area of row 35, but the problem is on 169, as you can see in the stack trace – Marin Shalamanov Apr 30 '16 at 21:23

0 Answers0