How do I use a compound drawable instead of a LinearLayout that contains an ImageView and a TextView

Ran the new Lint tool against my code. It came up with a lot of good suggestions, but this one I cannot understand. This tag and its children can be replaced by one and a compound drawable Issue: Checks whether the current node can be replaced by a TextView using compound drawables. A LinearLayout which … Read more

Handling click events on a drawable within an EditText

I have added an image right of the text in an EditText widget, using the following XML: <EditText android:id=”@+id/txtsearch” … android:layout_gravity=”center_vertical” android:background=”@layout/shape” android:hint=”Enter place,city,state” android:drawableRight=”@drawable/cross” /> But I want to clear the EditText when the embedded image is clicked. How can I do this? 41 Answers 41 Actually you don’t need to extend any class. … Read more