title: Send values from ViewPager Activity to a Fragment by bundle
body: <p>I have an ViewPager Activity that call the fragment that represent the slide layout.</p>
  
  <p>What i need is pass values from activity to fragment by bundle. 
  How i can do this? I try pass a int 2 in onCreate() but not work and i</p>
  
  <p>Activity:</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState){
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_screen_slide);
      Intent intent = new Intent(this,ScreenSlidePageFragment.class);
      Bundle bundle = new Bundle();
      bundle.putInt("SIDE",2);
      intent.putExtras(bundle);
  /**
   * Instantiate a ViewPager and a PagerAdapter
   */
  
      mPager = (ViewPager)findViewById(R.id.pager);
      mPagerAdapter = new ScreenSlidePagerAdapter(getSupportFragmentManager());
      mPager.setAdapter(mPagerAdapter);
      mPager.setOnPageChangeListener(new OnPageChangeListener() {
  
          @Override
          public void onPageSelected(int arg0) {
              if(itemOld &gt; arg0){
                  auxBack--;
                  SIDE=1;
              }
              else if(itemOld &lt; arg0){
                  auxFront++;
                  SIDE=0;
              }
          }
  
          @Override
          public void onPageScrolled(int arg0, float arg1, int arg2) {
              // TODO Auto-generated method stub
  
          }
  
          @Override
          public void onPageScrollStateChanged(int arg0) {
              // TODO Auto-generated method stub
  
          }
      });
  }
  
  @Override
  public void onBackPressed(){
      if(mPager.getCurrentItem()==0){
          super.onBackPressed();
      }else{
          mPager.setCurrentItem(mPager.getCurrentItem()-1);
      }
  } 
  
  
  /**
   * A simple pager adapter that represents 5 ScreenSlidePageFragment objects, in sequence
   */
  
  private class ScreenSlidePagerAdapter extends FragmentStatePagerAdapter{
      public ScreenSlidePagerAdapter(FragmentManager fm){
          super(fm);
      }
  
      @Override
      public ScreenSlidePageFragment getItem(int arg0) {
          return new ScreenSlidePageFragment();
      }
  
      @Override
      public int getCount() {
          //Toast.makeText(getApplicationContext(), "Num pages " + NUM_PAGES, Toast.LENGTH_LONG).show();
          return  NUM_PAGES;
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Fragment:</p>
  
  <pre><code>    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle    savedInstanceState) {
  
      int tID = ((ScreenSlidePagerActivity)getActivity()).getIntent().getExtras().getInt("SIDE");
      Toast.makeText(getActivity(), "Side selected....." +tID,   Toast.LENGTH_LONG).show();
  </code></pre>