In TextInputLayout change the color of hint for single letter or alphabet
<p>I have defined TextInputLayout programmatically in my Activity. I have added EditText inside that TextInputLayout, that to programmatically.</p>

<p>Now, I have to set the color of hint of that edittext. Here I just have to change the color of single alphabet of the hint.</p>

<pre><code>Example - Hint is like, Firstname *. Here  i want to change the color of "*" to Red and remaining hint as black in color.
</code></pre>

<p>I have already tried Html and Spannable String, but both are not working for TextInputLayout.</p>

<p>For Spannable i did</p>

<pre><code>SpannableString redSpannable = new SpannableString(red);
redSpannable.setSpan(new ForegroundColorSpan(Color.RED), 0, red.length(), 0);
Spanned hint = Html.fromHtml(string + redSpannable);
etDefault[j].setHint(hint);
</code></pre>

<p>For HTML,</p>

<pre><code>I used "font-color"
</code></pre>

<p>If anyone knows this, then share your opinion. </p>