title: Android text input - field name shown in field itself
body: <p>I am trying to achieve a log-in screen like the following:<img src="https://i.stack.imgur.com/QriU7.png" alt="enter image description here"></p>
  
  <p>Where the field's name is displayed in the field itself. I am using the ADT plugin in Eclipse. I tried setting the <code>android:text</code> attribute of the text input, but I don't think this is correct because through the password field, only the dots show (the redacted text), and not the text itself. What is the attribute then. I have looked in <a href="http://developer.android.com/reference/android/widget/EditText.html" rel="nofollow noreferrer">the documentation for the <code>EditText</code> widget</a>.</p>
  
  <p>The XML I currently have for the two <code>EditText</code> fields are:</p>
  
  <pre><code>    &lt;EditText android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/editText1" android:inputType="textEmailAddress" android:text="@string/username"&gt;
      &lt;requestFocus&gt;&lt;/requestFocus&gt;
  &lt;/EditText&gt;
  &lt;EditText android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/editText2" android:inputType="textPassword" android:text="@string/password" &gt;&lt;/EditText&gt;
  </code></pre>