title: Disable swiping between tabs
body: <p>I set up sliding tabs with two <code>Fragment</code>s each <code>Fragment</code> has a <code>Button</code> which goes to a <code>WebView</code>. The problem with this is when the <code>WebView</code> <code>Button</code> is clicked the sliding tabs are still activated and when a user tries to navigate within the <code>WebView</code> you end up swiping to the other tab. Is there a way in an on click method to disable the swiping ability of the tabs? Any help would be hugely appreciated!</p>
  
  <p>Here the code:</p>
  
  <pre><code>public class MyWebViewClass extends Fragment {
  
  private WebView mWebView;
  private Button mButton;
  
  public MyWebViewClass() {
      // Required empty public constructor
  }
  
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
                           Bundle savedInstanceState) {
      // Inflate the layout for this fragment
      View view = inflater.inflate(R.layout.fragment_webview, container, false);
  
      mWebView = (WebView) view.findViewById(R.id.WebView);
  
      mButton = (Button) view.findViewById(R.id.Button1);
      mButton.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              mWebView.setVisibility(View.VISIBLE);
              mButton.setVisibility(View.GONE);
              mWebView.getSettings().setJavaScriptEnabled(true);
              mWebView.loadUrl("www.google.com");
          }
      });
  
      return view;
  }
  </code></pre>