-4

when i change it ,it is not reflected in the app when i test it

<EditText
        android:id="@+id/editText1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_centerVertical="true"
    android:background="#EEEEEE"
    android:ellipsize="end"
    android:ems="10"
    android:focusableInTouchMode="true"
    android:hint="Entername"
    android:imeOptions="actionDone"
    android:padding="5dp"
    android:paddingBottom="40dp"
    android:paddingLeft="30dp"
    android:paddingTop="40dp"
    android:textColorHint="#AAAAAA"
    android:textSize="16sp"
    android:textStyle="italic" />

not able to see the hint as i have change it.

tinos07
  • 105
  • 1
  • 11
  • Try to replace this: android:hint"enter name" with this: android:hint="enter name". – Haresh Chhelana Jun 20 '14 at 06:33
  • Sorry guys i missed " = " while edit but its not working this way . BTW a thought for the ppl who really thought missing = as solution – tinos07 Jun 20 '14 at 09:06
  • editText.setOnFocusListener(new OnFocusListener(){ public void onFocus(){ editText.setHint(""); } }); this is the solution to the prob – tinos07 Jun 20 '14 at 09:25

6 Answers6

2

You have forgot "=" sign with Hint attribute.

<EditText
    android:id="@+id/editText1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_centerVertical="true"
    android:background="#EEEEEE"
    android:ellipsize="end"
    android:ems="10"
    android:focusableInTouchMode="true"
    android:hint="Entername"
    android:imeOptions="actionDone"
    android:padding="5dp"
    android:paddingBottom="40dp"
    android:paddingLeft="30dp"
    android:paddingTop="40dp"
    android:textColorHint="#AAAAAA"
    android:textSize="16sp"
    android:textStyle="italic" />
Pratik Dasa
  • 7,439
  • 4
  • 30
  • 44
0

you missed =

change this line

android:hint"enter name"

to this

android:hint = "enter name"
Shailendra Madda
  • 20,649
  • 15
  • 100
  • 138
0

you are missing = symbol replace this android:hint"enter name" with android:hint="enter name"

Vamshi
  • 1,495
  • 1
  • 15
  • 31
0

Try this..

editText.setOnFocusListener(new OnFocusListener(){
  public void onFocus(){
    editText.setHint("");
  }
});
Sathish
  • 33
  • 4
  • Bro editText.setOnFocuschange(new OnFocuschange(){ public void onFocus(){ editText.setHint(""); } }); – tinos07 Jun 20 '14 at 09:24
0
<EditText
    android:id="@+id/editText1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_centerVertical="true"
    android:background="#EEEEEE"
    android:ellipsize="end"
    android:ems="10"
    android:focusableInTouchMode="true"
    android:hint="Entername"
    android:imeOptions="actionDone"
    android:padding="5dp"
    android:paddingBottom="40dp"
    android:paddingLeft="30dp"
    android:paddingTop="40dp"
    android:textColorHint="#AAAAAA"
    android:textSize="16sp"
    android:textStyle="italic" />
MilapTank
  • 9,988
  • 7
  • 38
  • 53
0

You mistyped hint, maybe typo error

It should look like this

android:hint = "enter name"

where you had written it as android:hint "enter name". Missing "="

Aniruddha
  • 4,477
  • 2
  • 21
  • 39