I would like to implement a switch button, android.widget.Switch (available from API v.14).
<Switch
android:id="@+id/switch1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Switch" />
But I'm not sure how to add an event listener for the button. Should it be an "onClick" listener? And how would I know if it is toggled "on" or not?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…