title: Progress bar loading before I select the Tab
body: <p>Here is my code for Tab Initialization:</p>
  
  <pre><code>    private void initTabs() {
  
          serviceTabs.addTab(serviceTabs.newTab().setText("Request Appointment"));
          serviceTabs.addTab(serviceTabs.newTab().setText("Online Booking"));   
          serviceTabs.addTab(serviceTabs.newTab().setText("Feedback"));    
          serviceViewpager.setOffscreenPageLimit(serviceTabs.getTabCount());    
          final ViewPageAdapter adapter = new ViewPageAdapter(getChildFragmentManager(), serviceTabs.getTabCount(),
                  mContext);    
          serviceViewpager.setAdapter(adapter);    
          serviceViewpager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(serviceTabs));    
          serviceTabs.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {  
              @Override
              public void onTabSelected(TabLayout.Tab tab) {
                  serviceViewpager.setCurrentItem(tab.getPosition());
              }   
              @Override
              public void onTabUnselected(TabLayout.Tab tab) {
                  Log.i("", "on tab unselected Service");
              }    
              @Override
              public void onTabReselected(TabLayout.Tab tab) {
                  Log.i("", "on tab reselected Service ");
              }
          });
      }
  
      private class ViewPageAdapter extends FragmentStatePagerAdapter {
          int mNumOfTabs;   
          Context context;    
          ViewPageAdapter(FragmentManager fm, int numOfTabs, Context context) {
              super(fm);
              this.mNumOfTabs = numOfTabs;
              this.context = context;
          }
  
          @Override
          public Fragment getItem(int position) {    
              switch (position) {   
                  case 0:
                      return new CustomizeFragment();    
                  case 1:
                      Bundle url = new Bundle();                      url.putString(Constants.WEB_URL,Constants.APPOINTMENT_ONLINE_BOOKING);
                      return WebViewFragment.createInstance(url);
  
                  case 2:
                      return new CustomizeFragment();
  
                  default:
                      return null;
              }
          }   
          @Override
          public int getCount() {
              return mNumOfTabs;
          }
      }   
      @Override
      public void onDestroyView() {
          super.onDestroyView();           
          unbinder.unbind();
      }
  </code></pre>
  
  <p>And I'm having the progress bar loading inside the WebViewFragment as Follows:</p>
  
  <pre><code> public static WebViewFragment createInstance(Bundle urlArgs) {
          WebViewFragment webView = new WebViewFragment();
          webView.setArguments(urlArgs);
          return webView;
      }
      @Override
      public View onCreateView(LayoutInflater layoutInflater, ViewGroup container, Bundle saveInstanceState) {
          rootView = layoutInflater.inflate(R.layout.load_web_view, container, false);
          activity = getActivity();
          url=getArguments().getString(Constants.WEB_URL);
          mContext = activity.getApplicationContext();
          serviceAppointmentView = (WebView) rootView.findViewById(R.id.webView);    
          loadData();
          return rootView;
      }   
  public void loadData()
  {
      serviceAppointmentView.clearView();
      webSettings = serviceAppointmentView.getSettings();
      webSettings.setJavaScriptEnabled(true);
      webSettings.setSupportZoom(true);
      webSettings.setBuiltInZoomControls(true);
      webSettings.setLoadWithOverviewMode(true);
      webSettings.setUseWideViewPort(true);
  
      progress = new Progress(activity);
      pDialog = progress.showProgress();
      pDialog.setCanceledOnTouchOutside(true);
      serviceAppointmentView.loadUrl(url);
      serviceAppointmentView.setWebViewClient(new 
      DealerWebViewClient());
  }
  private class DealerWebViewClient extends WebViewClient {
      @Override
      public boolean shouldOverrideUrlLoading(WebView view, String url) 
      {
          view.loadUrl(url);
          return true;
      }
  
      @Override
      public void onPageFinished(WebView view, String url) {
          super.onPageFinished(view, url);
          progress.dismissProgress(pDialog);
      }
  }
  </code></pre>
  
  <p>Im Using the custom progress bar for Online Booking Tab. The problem here is the Progress begins to load before I tap the Online Booking tab. Please tell me where i'm doing the mistake or how could be this solved...Thanks for patiently looking on my code and any suggestions will be helpful for me...!</p>