Hi!

I have an issue where I can't change Switch textOn/Off at runtime. This 
means, that the following code, bound to a simple Button (for reproduction 
purposes) does not work:


 @Override

 public void onClick(View arg0) {

  _sw.setTextOn("On " + _counter);

  _sw.setTextOff("Off " + _counter);

  _sw.setText("Text" + _counter);

  _sw.setVisibility(_sw.getVisibility() == View.GONE ? View.VISIBLE : View.
GONE);

  _counter  ++;

  _sw.invalidate();

  _sw.setFocusable(true);

}


This code changes the text associated with Switch, but not On or Off labels 
on the button. Interestingly enough, if I call getTextOn or getTextOff, I 
get back the correct value, that was set on this Switch. Any ideas why this 
does not work as expected?

Regards,

 Miha.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to