title: On my custom ListView item, why is (string.length() <= 0) always true, while (string == "") is always false?
body: <p>I've created a custom ListView adapter/item. The item contains a CheckedTextView and a TextView. </p>
  
  <p>In the adapter's getView() method, the custom item is created and its setTask(Task) method is called right before it's returned. </p>
  
  <p>The setTask(Task) method gets 2 Strings and a boolean from the Task object passed in as a parameter. (I do recognize that its address is actually what gets passed.) </p>
  
  <p>One of the Strings is assigned to the custom item's TextView's text property IF that String contains text. Otherwise, the TextView's visible property is set to "gone."</p>
  
  <p>To make that determination, I check to see if the String's length is less than or equal to 0... it produces unexpected behavior - it ALWAYS evaluates true.</p>
  
  <p>If I change it to check if the String is equal to "", it always returns false.</p>
  
  <p>This leads me to believe that the String I'm checking is null. Why would that be?</p>
  
  <pre><code>protected void onFinishInflate() {
      super.onFinishInflate();
      checkbox = (CheckedTextView)findViewById(android.R.id.text1);   
      description = (TextView)findViewById(R.id.description);
  }
  
  public void setTask(Task t) {
      task = t;
      checkbox.setText(t.getName());
      checkbox.setChecked(t.isComplete());
      if (t.getDescription().length() &lt;= 0)
          description.setVisibility(GONE);
      else
          description.setText(t.getDescription());
  }
  </code></pre>
  
  <p>And here's the getView() method in the adapter:</p>
  
  <pre><code>public View getView(int position, View convertView, ViewGroup parent) {
  
      TaskListItem tli;
      if (convertView == null)
          tli = (TaskListItem)View.inflate(context, R.layout.task_list_item, null);
      else
          tli = (TaskListItem)convertView;
  
      tli.setTask(currentTasks.get(position));
      return tli; 
  }
  </code></pre>