Skip to content Skip to sidebar Skip to footer

Edittext Warning In Android App Development

While declaring EditText in xml file, I was warned exactly as given below No label views point to this text field with an android:labelFor='@+id/@+id/start' attribute EditText co

Solution 1:

I also had no idea what this error message was trying to inform me to do!

Thankfully I found an explanation: http://thecodeiscompiling.blogspot.com/2013/12/android-labelfor-waning-fix.html

the warning is telling you the EditText field does not have a TextView that can be read to a user when accessibility is turned on, since you haven't specified one with the android:labelFor attribute.

Solution 2:

Solution for this warning: No label views point to this text field with an android:labelFor="@+id/@+id/editText1" attribute

When you drag and drop and Text Fields into Graphical Layout you get this above error .

The generated code looks like this:

<EditText
android:id="@+id/editText1"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_alignParentLeft="true"android:layout_alignParentTop="true"android:layout_marginLeft="31dp"android:layout_marginTop="154dp"android:ems="10"android:inputType="textPersonName" >

<requestFocus />

Solution : add this label "android:labelFor="@+id/editText1" as shown below .

<EditText
android:id="@+id/editText1"android:labelFor="@+id/editText1"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_alignParentLeft="true"android:layout_alignParentTop="true"android:layout_marginLeft="31dp"android:layout_marginTop="154dp"android:ems="10"android:inputType="textPersonName" >

<requestFocus />
</EditText>

Solution 3:

Use id like following in your editText.

 android:id="@+id/editText1"

And then if you want to set labelFor then use

 android:labelFor="@id/editText1"

Solution 4:

Useandroid:labelFor="@+id/start"instead ofandroid:id="@+id/start".

Post a Comment for "Edittext Warning In Android App Development"