title: Android - SwitchCompact disable/stop default behaviour
body: <p>In my android project I have <a href="https://developer.android.com/reference/android/support/v7/widget/SwitchCompat.html" rel="nofollow">SwitchCompact</a>, <code>onClick</code> of which I do networking stuff and on basis response I want to change <code>SwitchCompact</code> to checked or not checked. </p>
  
  <p><strong>The problem I am facing now is :</strong><br>
     When I click on <code>SwitchCompact</code> it changes its status (<em>ie true to false and vice versa</em>) which is its normal behaviour. I want to disable its normal/default behaviour. </p>
  
  <p>Is that possible?</p>
  
  <pre><code>class MyClass extends Fragment implements View.OnClickListener {
      SwitchCompat switchCompact;
      @Nullable
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          //my view inflating stuff
          switchCompact= (SwitchCompat) view.findViewById(R.id.switch_id);
          switchCompact.setOnClickListener(this);
          return view;
      }
  
  
      @Override
      public void onClick(View view) {
          if (view.getId()==R.id.switch_id) {
              //make http request
          }
      }
  
      public void onResponse(Response response){
          switchCompact.setChecked(response.getStatus());
      }
  }
  </code></pre>
  
  <p>Any help will be appreciated. </p>