title: Error org.json.JSONException: Value 1 at error of type java.lang.Integer cannot be converted to boolean
body: <p>this is my script :</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>public class LoginActivity extends Activity {
   
   private static final String TAG = MainActivity.class.getSimpleName();
   private Button btnLogin;
   private Button btnLinkToRegister;
   private EditText inputEmail;
   private EditText inputPassword;
   private ProgressDialog pDialog;
   private SessionManager session;
  
   @Override
   public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_login);
  
    inputEmail = (EditText) findViewById(R.id.email);
    inputPassword = (EditText) findViewById(R.id.password);
    btnLogin = (Button) findViewById(R.id.btnLogin);
    btnLinkToRegister = (Button) findViewById(R.id.btnLinkToRegisterScreen);
  
    
    pDialog = new ProgressDialog(this);
    pDialog.setCancelable(false);
  
    
    session = new SessionManager(getApplicationContext());
  
    
    if (session.isLoggedIn()) {
     
     Intent intent = new Intent(LoginActivity.this, MainActivity.class);
     startActivity(intent);
     finish();
    }
  
    
    btnLogin.setOnClickListener(new View.OnClickListener() {
  
     public void onClick(View view) {
      String email = inputEmail.getText().toString();
      String password = inputPassword.getText().toString();
  
      
      if (email.trim().length() &gt; 0 &amp;&amp; password.trim().length() &gt; 0) {
       
       checkLogin(email, password);
      } else {
       
       Toast.makeText(getApplicationContext(),
         "Please enter the credentials!", Toast.LENGTH_LONG)
         .show();
      }
     }
  
    });
  
    
    btnLinkToRegister.setOnClickListener(new View.OnClickListener() {
  
     public void onClick(View view) {
      Intent i = new Intent(getApplicationContext(),
        RegisterActivity.class);
      startActivity(i);
      finish();
     }
    });
  
   }
  
  
   private void checkLogin(final String email, final String password) {
    
    String tag_string_req = "req_login";
  
    pDialog.setMessage("Logging in ...");
    showDialog();
  
    StringRequest strReq = new StringRequest(Method.POST,
      AppConfig.URL_REGISTER, new Response.Listener&lt;String&gt;() {
  
       @Override
       public void onResponse(String response) {
        Log.d(TAG, "Login Response: " + response.toString());
        hideDialog();
  
        try {
         JSONObject jObj = new JSONObject(response);
         boolean error = jObj.getBoolean("error");
  
         
         if (!error) {
          
          session.setLogin(true);
  
          
          Intent intent = new Intent(LoginActivity.this,
            MainActivity.class);
          startActivity(intent);
          finish();
         } else {
          
          String errorMsg = jObj.getString("error_msg");
          Toast.makeText(getApplicationContext(),
            errorMsg, Toast.LENGTH_LONG).show();
         }
        } catch (JSONException e) {
         
         e.printStackTrace();
        }
  
       }
      }, new Response.ErrorListener() {
  
       @Override
       public void onErrorResponse(VolleyError error) {
        Log.e(TAG, "Login Error: " + error.getMessage());
        Toast.makeText(getApplicationContext(),
          error.getMessage(), Toast.LENGTH_LONG).show();
        hideDialog();
       }
      }) {
  
     @Override
     protected Map&lt;String, String&gt; getParams() {
      
      Map&lt;String, String&gt; params = new HashMap&lt;String, String&gt;();
      params.put("tag", "login");
      params.put("idm", email);
      params.put("pwd", password);
  
      return params;
     }
  
    };
  
    
    AppController.getInstance().addToRequestQueue(strReq, tag_string_req);
   }
  
   private void showDialog() {
    if (!pDialog.isShowing())
     pDialog.show();
   }
  
   private void hideDialog() {
    if (pDialog.isShowing())
     pDialog.dismiss();
   }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>and the logcat shows :</p>
  
  <blockquote>
    <p>org.json.JSONException: Value 1 at error of type java.lang.Integer
    cannot be converted to boolean</p>
  </blockquote>
  
  <p>i use this script to make a login page with my own database. this script is using email as username but in my database, i use numbers as username.</p>