title: If Else Android (Else always activating)
body: <p>I have the following code in an AsyncTask.  name is either "item", "setMax" or a sentence like  "Creating Database (this is a one-time function)."</p>
  
  <p>My problem comes when I pass "item" into the code the code increments by 1 but then it sets the message to be "item Please wait...".  I think it is because it should be If/Else If/Else in sequence but I am not sure.   Is there a more efficient way or should I define constants and use a switch statement?</p>
  
  <pre><code>protected void onProgressUpdate(String... name) {
      if (name[0].equals("item")) {
          mDialog.incrementProgressBy(1);
      } if (name[0].equals("setMax")) {
          mDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
          mDialog.setMax(Integer.parseInt(name[1]));
      } else {
          mDialog.setMessage(name[0] + " Please wait...");
      }
  }
  </code></pre>