I have placed an image in edit text by the following code
<EditText
android:id="@+id/searchfilter"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:hint="Enter search keyword"
android:drawableRight="@drawable/ic_launcher"/>
I need to hide this image through java code
Thanks in advance
Try the folloing code
editText.setCompoundDrawablesWithIntrinsicBounds(0,0,0,0);
With this you can remove the drawable at the any side of your EditText
editText.setCompoundDrawables(null, null, null, null);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With