0

How to make the drawableright image on textview to appear and disappear programmatically in android. I have a textview and a button. When user press the button, it suppose to use the data on the textview to do something. However, if textview is empty, I want to show an error icon on the drawableright. Please advise.

Cœur
  • 37,241
  • 25
  • 195
  • 267
kggoh
  • 742
  • 1
  • 10
  • 24
  • Check for answer before asking question. http://stackoverflow.com/questions/22297073/how-to-programatically-set-drawableright-on-android-edittext – sabbir May 15 '15 at 02:00

1 Answers1

1

I think you are looking for http://developer.android.com/reference/android/widget/TextView.html#setError(java.lang.CharSequence)

Basically it will show a default error icon on the right inside the textview if you set it.

WenChao
  • 3,586
  • 6
  • 32
  • 46