title: Why is an if condition totally useless in an onPostExecute() in AyncTasks?
body: <p>I have an AsyncTask class in my application but what I noticed is that whatever the result passed on to to the onPostExecute function is, it will still direct the application to go to the else{} even though it perfectly fits the if statement. Why is that happening?</p>
  
  <p>Here is the AsyncTask I am running :</p>
  
  <pre><code>class CheckPassword extends AsyncTask&lt;String, String, String&gt;{
  
  @Override
  protected void onPreExecute() {
      super.onPreExecute();
      pDialog = new ProgressDialog(ChooseTable.this);
      pDialog.setMessage("Checking Password. Please wait...");
      pDialog.setIndeterminate(false);
      pDialog.setCancelable(false);
      pDialog.show();
  }
  
  @Override
  protected String doInBackground(String... p) {
      String password = p[0];
      int success;
      String access = "";
  
      try {
          // Building Parameter
          List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();
          params.add(new BasicNameValuePair("password", password));
  
          //ipaddress of server
  
          Intent i = getIntent();
          Bundle b = i.getExtras();
          ipaddress = b.getString("IP_Address");
  
          if(ipaddress != "" || ipaddress != "...:")
          {
              // single table url
              String url = "http://"+ipaddress+"/MenuBook/checkSpecial.php";
              Log.d("URL", url + "");
  
              JSONObject json = jsonParser.makeHttpRequest(
                      url, "GET", params);
              Log.d("JSON OBJECT", json+"");
              // json success tag
              success = json.getInt(TAG_SUCCESS);
              if (success == 1) {
                  // successfully received table details
                  JSONArray result = json
                          .getJSONArray("result"); // JSON Array
  
                  // get table availability from JSON Array
                  JSONObject accessObj = result.getJSONObject(0);
                  access= accessObj.getString("allowAccess");
  
              }
              else
              {
                  status = "TABLE NOT FOUND";
              }
          }
          else
          {
              status = "FAILED TO RETRIEVE SERVER IP ADDRESS";
          }
      } catch (JSONException e) {
          e.printStackTrace();
      }
      Log.d("ALLOW ACCESS", access+"");
      return access;
  }
  
  @Override
  protected void onPostExecute(String result) {
      pDialog.dismiss();
      Log.d("RESULT", result+"");
      if(result == "YES"){
          Toast.makeText(ChooseTable.this, "ACCESS ALLOWED", Toast.LENGTH_LONG).show();
      }else if (result== "NO"){
          Toast.makeText(ChooseTable.this, "Access Denied", Toast.LENGTH_LONG).show();
      }else{
          Toast.makeText(ChooseTable.this, status, Toast.LENGTH_LONG).show();
      }
  
  }
  }
  </code></pre>