title: Error Parsing data org.json.JSONException: Value 0 of type java.lang.integer cannot be converted to JSONObject
body: <p>I'm trying to create a login page for my app using JSONParser, but everytime I click the login button, the error just keep coming on my username edittextbox "Java.lang.NullPointerException"</p>
  
  <p>Here's my login.java:</p>
  
  <pre><code>public class login extends Activity{
      private static final String loginurl = "http://10.0.2.2/koperasidb/login.php";
      EditText kode,pw;
      TextView error;
      Button login;
      String i;
      private static final String TAG_SUCCESS = "success";
      private Session session;
      JSONParser1 jsonParser = new JSONParser1();
  
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.login);
  
          session = new Session(this);
          kode = (EditText) findViewById(R.id.kode);
          pw = (EditText) findViewById (R.id.password);
          login = (Button) findViewById (R.id.login);
          error = (TextView) findViewById (R.id.error);
  
          login.setOnClickListener(new View.OnClickListener(){
          @Override     
              public void onClick(View v) {
              List&lt;NameValuePair&gt; postParameters = new ArrayList&lt;NameValuePair&gt;();
              postParameters.add(new BasicNameValuePair("kode", kode.getText().toString()));
              postParameters.add(new BasicNameValuePair("password", pw.getText().toString()));
              int success;
  
  
              try { 
                  JSONObject json = jsonParser.makeHttpRequest(loginurl, "GET", postParameters);
                  success = json.getInt(TAG_SUCCESS);
                  if (success ==1){
                      error.setText("Correct Username or Password");
                      session.setkdanggota(kode.getText().toString());
                      berhasil(v);  
                  }
                  else { 
                      error.setText("Sorry!! Wrong Username or Password Entered");
                  }
              }
              catch (Exception e) {
                  kode.setText(e.toString());
              }
              }
          });
          //Toast.makeText(this,"berhasil",3000).show();
      }
  
              public void berhasil (View theButton)
              {
                  Intent s = new Intent (this, Home.class);
                  startActivity(s);
              }
          }
  </code></pre>
  
  <p>And here's my login.php:</p>
  
  <pre><code>    &lt;?php
      include ("koneksi.php");
      $kd=$_POST['kode'];
      $pw=$_POST['password'];
  
      $query = "SELECT * FROM anggota_baru WHERE kd_anggota = '$kd' AND no_identitas ='$pw'";
      $result = mysql_query($query) or die("Unable to verify user because : " . mysql_error());
  
     if (mysql_num_rows($result) == 1){
          echo 1;
          $response["success"] = 1;
      }
     else {
          // print status message
         echo 0;
         $response["success"] = 0;
      }
  
      ?&gt;
  </code></pre>