I have **1 activity** and **3 fragments** in this activity.

In 3 fragments I have booleans returning true when checkbox is checked or edittext is not empty..

I want to unable button when editTexts are not empty and my checkbox is checked..

When I added something like sexMan.isChecked() to method EditTextCompleted()
my app crushing....

So how can I connects this conditions in one place?

Checkbox Listener

```
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {

    if (isChecked){
        mSendInfoFromBmrFragment.sexChecked(true);
        switch (buttonView.getId()){

            case R.id.sexMan:
                mSendInfoFromBmrFragment.sex(BmrCalculation.SEX_MAN);
                sexMan.setChecked(true);
                sexWoman.setChecked(false);
                break;

            case R.id.sexWoman:
                sexMan.setChecked(false);
                sexWoman.setChecked(true);
                mSendInfoFromBmrFragment.sex(BmrCalculation.SEX_WOMAN);
                break;

```

Edit Text listener

@Override
 public void afterTextChanged(Editable s) {

```
    if ( s == weightEditText.getEditableText()){
        mSendInfoFromBmrFragment.getweight(Integer.parseInt(s.toString()));
        mWeight = Integer.parseInt(s.toString());
    } else if ( s == heightEditText.getEditableText()) {
        mSendInfoFromBmrFragment.getheight(Integer.parseInt(s.toString()));
        mHeight = Integer.parseInt(s.toString());
    } else if ( s == ageEditText.getEditableText()){
        mSendInfoFromBmrFragment.getage(Integer.parseInt(s.toString()));
        mAge = Integer.parseInt(s.toString());
    }

    if ( (!(weightEditText.getEditableText().toString().equals("")) && !(heightEditText.getEditableText().toString().equals("")) && !(ageEditText.getEditableText().toString().equals("")))) {
        mSendInfoFromBmrFragment.editTextComplete(true);
    } else {
        mSendInfoFromBmrFragment.editTextComplete(false);
    }

}

```

Interface

```
public interface sendInfoFromBmrFragment {

        public void getheight(int height);
        public void getweight(int weight);
        public void getage(int age);
        public void editTextComplete(boolean editTextComplete);
        public void sex(String sex);

    }

```