title: Trouble with setting visibility of a group in a tablayout fragment
body: <p>I am trying to use a switch to toggle the visibility of a group in constraint layout.  I keep getting an error on the setVisibility method that Android Studio "Cannot resolve method 'setVisibility(int)'."  I can figure out what I'm missing.</p>
  
  <pre><code>import android.os.Bundle;
  import android.support.annotation.Nullable;
  import android.support.v4.app.Fragment;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.CompoundButton;
  import android.widget.Switch;
  
  import java.security.acl.Group;
  
  public class FragmentCO2Settings extends Fragment {
  
  public static final String ARG_PAGE = "ARG_PAGE";
  
  private int mPage;
  private Group fractiongroup;
  private Switch fractionswitch;
  
  public static FragmentCO2Settings newInstance(int page) {
      Bundle args = new Bundle();
      args.putInt(ARG_PAGE, page);
      FragmentCO2Settings fragment = new FragmentCO2Settings();
      fragment.setArguments(args);
      return fragment;
  }
  
  public FragmentCO2Settings() {
  }
  
  @Override
  public void onCreate(@Nullable Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  }
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
      View rootView = inflater.inflate(R.layout.co2extractor_settings_fragment, container, false);
      fractionswitch = (Switch) getView().findViewById(R.id.fractswitch);
      fractiongroup = (Group) getView().findViewById(R.id.Fractiongroup);
      fractionswitch.setChecked(true);
      fractionswitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
              if(isChecked){
                  fractiongroup.setVisibility(View.VISIBLE);
              } else {
                  fractiongroup.setVisibility(View.GONE);
              }
          }
      });
      return rootView;
  
      }
  }
  </code></pre>
  
  <p>The fractionswitch is set to checked by default and the fraction group set to visible.  I would like to set it so that when the fractionswitch is unclicked the fraction group will change visibility to GONE.</p>