title: Entering both if AND else statement?
body: <p>So I've got this code (updated for solution).</p>
  
  <pre><code>    @Override
      public View getView(int position, View convertView, ViewGroup parent) {
          ...
          final Direction d = directions.get(position);
          if (d != null) {
  
              TextView direction = (TextView) row.getTag(R.id.directionTextView);
              TextView departure1 = (TextView) row.getTag(R.id.departure1);
              TextView departure2 = (TextView) row.getTag(R.id.departure2);
              TextView departure3 = (TextView) row.getTag(R.id.departure3);
  
              direction.setText(d.getName());
  
              if (d.getTimeStamps().size() == 0) {
                  departure1.setText(R.string.nodepartures);
                  departure1.setTextColor(R.color.grey);
              } else {
                  for (int i = 0; i &lt; d.getTimeStamps().size(); i++) {
                      switch (i) {
                      case 0:
                          departure1.setText(d.getTimeStamps().get(i));
                          break;
                      case 1:
                          departure2.setText(d.getTimeStamps().get(i));
                          break;
                      case 2:
                          departure3.setText(d.getTimeStamps().get(i));
                          break;
                      default:
                          break;
                      }
                  }
              }
          }
          return row;
      }
  }
  </code></pre>
  
  <p>The problem I was having was that one of the TextViews would turn grey when it wasn't supposed to. I tried fixing it by always setting the text to black again, but that turned every single one of them grey. Until I tried:</p>
  
  <pre><code>setTextColor(context.getResources().getColor(R.color.black));
  </code></pre>
  
  <p>instead of just</p>
  
  <pre><code>setTextColor(R.color.black);
  </code></pre>
  
  <p>Don't know why the latter works when setting text grey, but there it is. I guess I'm just a little retarded. :)</p>