0

I am using a TextView tag to implement an error message. This error message's value depends on a number of different conditions, and therefore cannot be a single string. I am trying to make it so that the error message displayed is the output of a getErrorMessage method. How can I do that without using android:onClick, since it's not quite a button, but rather a text whose value changes from time to time?

Sorry if this isn't quite clear, this is my first time using Android Studio as well as Stack Overflow.

  • 1
    Step #1: sometime after you inflate this layout file, call `findViewById()` to retrieve this `TextView` by whatever `android:id` value you gave it. Step #2: whenever "from time to time" occurs, call `setText()` on this `TextView` with the value from `getErrorMessage()`. – CommonsWare Jan 29 '17 at 00:24
  • @CommonsWare It worked ! Thank you so much ! – Patrick Ghazal Jan 29 '17 at 00:54

0 Answers0