title: TextInputLayout error icon appear in both side
body: <p>i'm working on android application for registration operations
  i'm using   </p>
  
  <blockquote>
    <p>compile SdkVersion 24</p>
    
    <p>buildToolsVersion "24.0.1"</p>
    
    <p>compile 'com.android.support:appcompat-v7:24.2.1'<br>
    compile
    'com.android.support:design:24.2.1'</p>
  </blockquote>
  
  <p>and the xml code for this layout is:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:fitsSystemWindows="true"&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="vertical"
          android:paddingLeft="24dp"
          android:paddingRight="24dp"
          android:paddingTop="56dp"&gt;
  
          &lt;ImageView
              android:layout_width="wrap_content"
              android:layout_height="72dp"
              android:layout_gravity="center_horizontal"
              android:layout_marginBottom="24dp"
              android:src="@drawable/logo" /&gt;
  
          &lt;!-- Full Name Label --&gt;
          &lt;android.support.design.widget.TextInputLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginBottom="8dp"
              android:layout_marginTop="8dp"&gt;
  
              &lt;EditText
                  android:id="@+id/input_full_name"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:hint="@string/Full_Name"
  
                  android:inputType="textCapWords" /&gt;
          &lt;/android.support.design.widget.TextInputLayout&gt;
  
          &lt;!-- User Name Label --&gt;
          &lt;android.support.design.widget.TextInputLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginBottom="8dp"
              android:layout_marginTop="8dp"&gt;
  
              &lt;EditText
                  android:id="@+id/input_user_name"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:hint="@string/User_Name"
  
                  android:inputType="textCapWords" /&gt;
          &lt;/android.support.design.widget.TextInputLayout&gt;
  
          &lt;!--Gender--&gt;
          &lt;RadioGroup
              android:id="@+id/RG"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_margin="10dp"
              android:orientation="horizontal"&gt;
  
              &lt;RadioButton
                  android:id="@+id/male"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  android:drawableLeft="@drawable/man"
                  android:text="@string/Male" /&gt;
  
              &lt;RadioButton
                  android:id="@+id/female"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  android:drawableLeft="@drawable/woman"
                  android:text="@string/FeMale" /&gt;
          &lt;/RadioGroup&gt;
  
          &lt;!--Birthday--&gt;
          &lt;TextView
              android:id="@+id/input_birthday"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_margin="10dp"
              android:text="@string/BirthDay"&gt;&lt;/TextView&gt;
  
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_margin="10dp"
              android:orientation="horizontal"&gt;
  
              &lt;android.support.design.widget.TextInputLayout
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_margin="10dp"
  
                  android:layout_weight="1"&gt;
  
                  &lt;EditText
                      android:id="@+id/spinner_day"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:hint="@string/Day"
                      android:inputType="number" /&gt;
              &lt;/android.support.design.widget.TextInputLayout&gt;
  
              &lt;android.support.design.widget.TextInputLayout
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_margin="10dp"
                  android:layout_weight="1"&gt;
  
                  &lt;EditText
                      android:id="@+id/spinner_month"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:hint="@string/Month"
                      android:inputType="number" /&gt;
              &lt;/android.support.design.widget.TextInputLayout&gt;
  
              &lt;android.support.design.widget.TextInputLayout
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_margin="10dp"
                  android:layout_weight="1"&gt;
  
                  &lt;EditText
                      android:id="@+id/spinner_year"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:hint="@string/Year"
                      android:inputType="number" /&gt;
              &lt;/android.support.design.widget.TextInputLayout&gt;
  
  
          &lt;/LinearLayout&gt;
          &lt;LinearLayout
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:orientation="horizontal"&gt;
              &lt;TextView
                  android:id="@+id/txt_lable_p"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_margin="16dp"
                  android:text="@string/Add_Contact_Info"
                  android:textColor="@color/ColorPrimaryDark"
                  android:textSize="@dimen/textSize_medium3" /&gt;
              &lt;ImageView
                  android:id="@+id/infoContact"
                  android:layout_marginTop="12dp"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:src="@android:drawable/ic_menu_info_details"/&gt;
          &lt;/LinearLayout&gt;
  
          &lt;!-- WhatsApp Label --&gt;
          &lt;android.support.design.widget.TextInputLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginBottom="8dp"
              android:layout_marginTop="8dp"&gt;
  
              &lt;EditText
                  android:id="@+id/input_whatsApp"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:hint="@string/WhatsApp"
                  android:inputType="number" /&gt;
          &lt;/android.support.design.widget.TextInputLayout&gt;
  
          &lt;!-- PhoneNumber Label --&gt;
          &lt;android.support.design.widget.TextInputLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginBottom="8dp"
              android:layout_marginTop="8dp"&gt;
  
              &lt;EditText
                  android:id="@+id/input_phoneNumber"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:hint="@string/PhoneNumber"
                  android:inputType="number" /&gt;
          &lt;/android.support.design.widget.TextInputLayout&gt;
  
          &lt;!-- Facebook Label --&gt;
          &lt;android.support.design.widget.TextInputLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginBottom="8dp"
              android:layout_marginTop="8dp"&gt;
  
              &lt;EditText
                  android:id="@+id/input_facebook"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:hint="@string/Facebook"
                  android:inputType="textWebEditText" /&gt;
          &lt;/android.support.design.widget.TextInputLayout&gt;
  
          &lt;!-- Twitter Label --&gt;
          &lt;android.support.design.widget.TextInputLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginBottom="8dp"
              android:layout_marginTop="8dp"&gt;
  
              &lt;EditText
                  android:id="@+id/input_twitter"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:hint="@string/Twitter"
                  android:inputType="textWebEditText" /&gt;
          &lt;/android.support.design.widget.TextInputLayout&gt;
  
          &lt;!-- Password Label --&gt;
          &lt;android.support.design.widget.TextInputLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginBottom="8dp"
              android:layout_marginTop="8dp"&gt;
  
              &lt;EditText
                  android:id="@+id/input_password"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:hint="@string/Password"
                  android:inputType="textPassword" /&gt;
          &lt;/android.support.design.widget.TextInputLayout&gt;
  
          &lt;!-- Confirm Password Label --&gt;
          &lt;android.support.design.widget.TextInputLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginBottom="8dp"
              android:layout_marginTop="8dp"&gt;
  
              &lt;EditText
                  android:id="@+id/input_confirm_password"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:hint="@string/Confirm_Password"
                  android:inputType="textPassword" /&gt;
          &lt;/android.support.design.widget.TextInputLayout&gt;
  
          &lt;!-- Question Password Label --&gt;
          &lt;TextView
              android:id="@+id/QPassword"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_margin="10dp"
              android:text="@string/QPassword" /&gt;
  
          &lt;android.support.design.widget.TextInputLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginBottom="8dp"
              android:layout_marginTop="8dp"&gt;
  
              &lt;android.support.v7.widget.AppCompatEditText
                  android:id="@+id/input_Q_password"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:hint="@string/Q1"
                  android:inputType="text" /&gt;
          &lt;/android.support.design.widget.TextInputLayout&gt;
  
          &lt;!--job--&gt;
          &lt;LinearLayout
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:orientation="horizontal"&gt;
          &lt;RadioGroup
              android:id="@+id/RGJob"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_margin="10dp"
              android:orientation="vertical"&gt;
              &lt;LinearLayout
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:orientation="horizontal"&gt;
              &lt;RadioButton
                  android:id="@+id/lookjob"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="@string/LookJob" /&gt;
  
                  &lt;ImageView
                      android:id="@+id/infoLookJob"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:src="@android:drawable/ic_menu_info_details"/&gt;
              &lt;/LinearLayout&gt;
              &lt;LinearLayout
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:orientation="horizontal"&gt;
              &lt;RadioButton
                  android:id="@+id/havejob"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="@string/HaveJob" /&gt;
                  &lt;ImageView
                      android:id="@+id/infoHaveJob"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:src="@android:drawable/ic_menu_info_details"/&gt;
              &lt;/LinearLayout&gt;
              &lt;RadioButton
                  android:id="@+id/None"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:checked="true"
                  android:text="@string/NoThing" /&gt;
          &lt;/RadioGroup&gt;
          &lt;/LinearLayout&gt;
  
          &lt;TextView
              android:id="@+id/attchjob"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_margin="10dp"
              android:text="@string/AttachAds"
              android:visibility="gone" /&gt;
  
          &lt;android.support.design.widget.TextInputLayout
              android:id="@+id/ads_layout"
              android:layout_width="match_parent"
              android:layout_height="170dp"
              android:layout_margin="10dp"
              android:background="@drawable/et"
              android:visibility="gone"&gt;
  
              &lt;EditText
                  android:id="@+id/input_ads"
                  android:layout_width="match_parent"
                  android:layout_height="160dp"
                  android:layout_margin="10dp"
                  android:gravity="top"
                  android:inputType="textCapSentences|textMultiLine" /&gt;
          &lt;/android.support.design.widget.TextInputLayout&gt;
  
  
          &lt;Button
              android:id="@+id/attach_img"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="center_horizontal"
              android:layout_margin="10dp"
              android:text="@string/Image"
              android:textAllCaps="false"
              android:textColor="#ffffff"
              android:theme="@style/MyButton"
              android:visibility="gone" /&gt;
  
          &lt;TextView
              android:id="@+id/url"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_margin="10dp"
              android:visibility="gone" /&gt;
  
          &lt;ImageView
              android:id="@+id/urlimage"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_margin="10dp"
              android:adjustViewBounds="true"
              android:visibility="gone" /&gt;
  
          &lt;!-- Signup Button --&gt;
          &lt;android.support.v7.widget.AppCompatButton
              android:id="@+id/btn_signup"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:layout_marginBottom="24dp"
              android:layout_marginTop="24dp"
              android:padding="12dp"
              android:text="@string/signUp" /&gt;
  
          &lt;TextView
              android:id="@+id/link_login"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:layout_marginBottom="24dp"
              android:gravity="center"
              android:text="@string/AlreadyLogin"
              android:textColor="@color/primary_dark"
              android:textSize="16dip" /&gt;
      &lt;/LinearLayout&gt;
  &lt;/ScrollView&gt;   
  </code></pre>
  
  <p>when i run it , it appeared like this 
  <a href="http://i.stack.imgur.com/ygOKW.jpg" rel="nofollow">register layout</a>  </p>
  
  <p>java code for this field:</p>
  
  <pre><code>if (answerPassword.isEmpty() || Password.length() &lt; 2 ) {
              Answer.setError(getResources().getString(R.string.ErrorAnswer));
  
          }    
  </code></pre>
  
  <p>the error icon appear in both side of textinputlayout , why ?</p>