title: Android fragmentpageradapter update data
body: <p>Here , I explain my problem. I install a ViewPager and FragmentPagerAdapter so you can slide between two page.
  Each fragment contains data ( TextView ) .
  When creating my ViewPager with the data passed as a parameter everything goes well.
  But if I want to change the data (ie the content of the fragment) it does not refresh</p>
  
  <pre><code>public class MaPagerAdapter extends FragmentPagerAdapter {
  
      private Meteo[]lameteo;
  
  
      public MaPagerAdapter(FragmentManager fm, Meteo[]lameteo) {
              super(fm);
              this.lameteo = lameteo;
              Log.i("aa", "ville maPagerAdapter"+lameteo[0].getLoc());
      }
  
      @Override
      public Fragment getItem(int position) {
          switch(position) {
          case 0: return page_droite.newInstance(lameteo[0]);
          case 1: return page_gauche.newInstance(lameteo);
          }
          return null;
      }
      @Override
      public int getItemPosition(Object object) {
          return POSITION_NONE;
      }
  
      public void setData(Meteo[] meteo){
          this.lameteo=meteo;
      }
      @Override
      public int getCount() {
              return 2;
      }
  </code></pre>
  
  <p>}</p>
  
  <p>And my main</p>
  
  <pre><code>if(mPagerAdapter!=null){ //if pagerAdapter already initialized
          mPagerAdapter.setData(meteo);
          mPagerAdapter.notifyDataSetChanged();
          }else
          mPagerAdapter = new MaPagerAdapter(getSupportFragmentManager(), meteo);
          ViewPager pager = (ViewPager) findViewById(R.id.viewpager);
          pager.setAdapter(mPagerAdapter);
  </code></pre>
  
  <p>Can you help me please ?</p>