this is my code:
tglSwitch.setOnCheckedChangeListener(new OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
int t= isChecked ? 1 : 0;
Log.i("t",t);
}
}
when the user check or uncheck the togglebutton , the above code will run, and when i use this code too.
tglSwitch.setChecked(true);
how can i detect OnCheckedChangeListener() only when user do it?