Android text input layout
<p>I have a text input layout and I want to use that to show an error message if the data entered in an edit text inside it is incorrect. The definitions are as follows:</p>

<pre><code>&lt;android.support.design.widget.TextInputLayout
            android:id="@+id/number_input_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:theme="@style/TextLabelWhite" &gt;

            &lt;EditText
                android:id="@+id/number_edit_text"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:digits="01234 56789"
                android:hint="Number"
                android:inputType="number"
                android:textColor="@color/white" /&gt;
&lt;/android.support.design.widget.TextInputLayout&gt;
</code></pre>

<p>The style is defined as follows:</p>

<pre><code>&lt;style name="TextLabelWhite" parent="TextAppearance.AppCompat"&gt;
    &lt;item name="android:textColorHint"&gt;@color/white&lt;/item&gt;
    &lt;item name="colorAccent"&gt;@color/white&lt;/item&gt;
    &lt;item name="colorControlNormal"&gt;@color/white&lt;/item&gt;
    &lt;item name="colorControlActivated"&gt;@color/white&lt;/item&gt;
&lt;/style&gt;
</code></pre>

<p>Now if the data entered is not correct I do the following operations:</p>

<pre><code>TextInputLayout numberInputLayout = (TextInputLayout) view.findViewById(R.id.number_input_layout);
EditText numberEditText = (EditText) getView().findViewById(R.id.number_edit_text);
numberEditText.getBackground().setColorFilter(Color.RED, PorterDuff.Mode.SRC_ATOP);
numberInputLayout.setErrorEnabled(true);
numberEditText.setError("Tis an error dear");
Toast.makeText(getActivity(), error, Toast.LENGTH_SHORT).show();
</code></pre>

<p>When all of this is done I get the error: </p>

<p><code>Can't convert to color: type=0x2</code> on the line <code>numberInputLayout.setErrorEnabled(true);</code></p>

<p>Where am I going wrong?</p>

<p>EDIT 1: As soon as I remove the <code>TextLabelWhite</code> theme, it starts working. But the theme is necessary.</p>