title: How to update Fragments in ViewPager after updating Adapter?
body: <p>I call <code>loadCategory</code> method from different items of navigation drawer.
  On the first call <code>ViewPager</code> load the correct data. But on the second call data doesn't change. ViewPager shows the old data, Please help.</p>
  
  <p>Thanks in advance.</p>
  
  <pre><code>    private void loadCategory(int id) {
            toolbar.setTitle(categoryList[id]);
            adapter = new PagerAdapter(getSupportFragmentManager());
            mViewPager.setAdapter(adapter);
            adapter.notifyDataSetChanged();
      }
  
      public class PagerAdapter extends FragmentPagerAdapter{
  
      public PagerAdapter(FragmentManager fm) {
          super(fm);
      }
  
      @Override
      public void destroyItem(ViewGroup container, int position, Object object) {
          super.destroyItem(container, position, object);
      }
  
      @Override
      public Fragment getItem(int position) {
          Bundle bundle = new Bundle();
          bundle.putString("shayari",currentShayaaris[position]);
          Fragment SFragment = new ShayariFragment();
          SFragment.setArguments(bundle);
          return SFragment;
      }
  
      @Override
      public int getCount() {
          return currentShayaaris.length;
      }
  }
  </code></pre>