how to check switch position in to other fragment
First Fragment
textView=view.findViewById(R.id.textview_first);
// check second fragment switch position and change text
Second Fragment
aSwitch=view.findViewById(R.id.switch1);
aSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked){
//Checnge first fragment textview text to checked
}else {
//Checnge first fragment textview text to unchecked
}
}
});