EditText cursor and pointer color for below android 5.0
<p>I am trying to change EditText cursor pointer color (from the primary color blue to white), but no solution is working for my project. I have tried to develop a demo project, where the same code is working fine. <b>This code is working fine for &gt;=android 5.0</b></p>
<p>I do not know, which attribute is overwritten by my value. I have two options to encounter this problem :<br /></p>
<ol>
<li>Find the attribute which is controlling that color value.<br /></li>
<li>Change the color value by java code when page loads (in onViewCreated).</li>
</ol>
<p>Please suggest how to resolve this issue.</p>
<h3>styles.xml</h3>
<pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;resources&gt;

    &lt;style name=&quot;my_text_layout_style&quot;&gt;
        
        &lt;item name=&quot;android:textColor&quot;&gt;#FFF&lt;/item&gt;
        &lt;item name=&quot;android:textColorHint&quot;&gt;#FFF&lt;/item&gt;
      
        &lt;item name=&quot;colorAccent&quot;&gt;#FFF&lt;/item&gt;
        &lt;item name=&quot;colorControlNormal&quot;&gt;#FFF&lt;/item&gt;
        &lt;item name=&quot;colorControlActivated&quot;&gt;#FFF&lt;/item&gt;

        &lt;item name=&quot;colorControlHighlight&quot;&gt;#FFF&lt;/item&gt;

    &lt;/style&gt;

    

    &lt;style name=&quot;my_edit_text_style&quot;&gt;
        &lt;item name=&quot;colorAccent&quot;&gt;#FFF&lt;/item&gt;
        &lt;item name=&quot;android:editTextStyle&quot;&gt;@style/MyEditTextStyle&lt;/item&gt;
    &lt;/style&gt;

    &lt;style name=&quot;MyEditTextStyle&quot; parent=&quot;Widget.AppCompat.EditText&quot; /&gt;
&lt;/resources&gt;
</code></pre>
<h3>layout.xml</h3>
<pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
    android:layout_width=&quot;match_parent&quot;
    android:layout_height=&quot;match_parent&quot;
    xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
    android:background=&quot;@color/base_disable_btn_bg_color&quot;
    android:orientation=&quot;vertical&quot;&gt;

    &lt;android.support.design.widget.TextInputLayout
        android:layout_width=&quot;match_parent&quot;
        android:hint=&quot;just a hint&quot;
        app:hintTextAppearance=&quot;@style/my_text_layout_style&quot;
        android:theme=&quot;@style/my_text_layout_style&quot;
        android:layout_height=&quot;wrap_content&quot;&gt;

        &lt;android.support.design.widget.TextInputEditText
            android:layout_width=&quot;match_parent&quot;
            android:theme=&quot;@style/my_edit_text_style&quot;
            android:layout_height=&quot;wrap_content&quot; /&gt;

    &lt;/android.support.design.widget.TextInputLayout&gt;
&lt;/LinearLayout&gt;
</code></pre>
<h3>Tried to add view programmatically but no success</h3>
<pre><code>AppLinearLayout appLinearLayout = (AppLinearLayout) view.findViewById(R.id.some_id);
EditText editText = new EditText(new ContextThemeWrapper(getContext(), R.style.AppTheme_Cursor));
ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
editText.setLayoutParams(params);
appLinearLayout.addView(editText);
</code></pre>
<p><a href="https://i.stack.imgur.com/bicQO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bicQO.png" alt="screenshot" /></a></p>