I create a switch button programmatically. The problem is that the button does not display the text ON / OFF . This is the creation code:
final RelativeLayout.LayoutParams ll = new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT); ll.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); sw.setLayoutParams(ll); sw.setTextOn(values[0].getName()); sw.setTextOff(values[1].getName()); values[0].getName() returns "OK", and values[1].getName() returns "NOK"
What could be?
Thanks Jaime
android android-layout android-switch
jstuardo
source share