title: refresh tabs fragment and viewpager
body: <p>I setup my viewpager according to the data I get from my database. If there are 3 person, I setup 3 tabs.
  Now through settings, I can add a delete a person. I want to reload the tabs according to the updated data. I know onResume is called again when my fragment is accessed. I'm doing this but this is not refreshing the tabs, they should have one less or one more tab depending on the update in database. </p>
  
  <pre><code> @Override
      public void onResume(){
          super.onResume();
          Log.d("Refresh", " "+ MainActivity.allowRefresh);
          if (MainActivity.allowRefresh)
          {
  
              MainActivity.allowRefresh = false;
  
              setupViewPager(viewPager);
              tabLayout.setupWithViewPager(viewPager);
          }
  
  
      }
  </code></pre>