title: Android EditText setHint programmatically not working
body: <p>I have the following code - When <code>EditText</code> is under focus I want the hint disappear, else display it back. In the debug I see that the <code>EditText</code> has and lose focus correctly (The <code>setHint</code> code line is executed) but the hint is not displayed (the hint removes but not comes back in lost focus). I double checked other places in the code and I don't overwrite it with something that erases the hint except in the <code>hasFocus</code> below.</p>
  
  <pre><code>editText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
      @Override
      public void onFocusChange(View v, boolean hasFocus) {
          if (hasFocus) {
              editText.setHint(getString(R.string.empty_string));
          } else {
              editText.setHint(getString(R.string.hint_string));
          }
      }
  }); 
  
  &lt;EditText
      android:layout_width="match_parent"
      android:layout_height="56dp"
      android:hint="@string/hint_string"
      android:textSize="22sp"
      android:textColor="@color/white"
      android:textColorHint="@color/white"
      android:fontFamily="sans-serif-light"
      android:layout_marginLeft="7dp"
      android:layout_marginRight="7dp"
      android:paddingLeft="24dp"
      android:paddingRight="24dp"
      android:elevation="3dp"
      android:textCursorDrawable="@null"
      android:background="@color/primary_accent"
      android:layout_below="@id/main_activity_toolbar"
      android:layout_gravity="center_horizontal" /&gt;
  </code></pre>