How I can implement a warning in a text field like this in android:

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Simply use TextView.setError method.
This will display error message as shown in the image with default error icon. You can even change the icon using the second variant of the setError method.
To clear the error simply pass null as the method argument.
for more details check:
http://developer.android.com/reference/android/widget/TextView.html#setError(java.lang.CharSequence)