title: android send data to fragment from activity
body: <p>I have a map activity. When I click on the info window of the marker an intent will send the id to my fragment. In my map activity :</p>
  
  <pre><code>map.setOnInfoWindowClickListener(
      new OnInfoWindowClickListener() {
          @Override
          public void onInfoWindowClick(Marker m) {
              Intent nextScreen = new Intent (Map.this,
              PHDetail.class);
              Bundle bundle = new Bundle();
              bundle.putString("test", "id");
              Callfor c = new Callfor();
              c.setArguments(bundle);
              startActivityForResult(nextScreen, 101);
          }
      });
  </code></pre>
  
  <p>In my fragment :</p>
  
  <pre><code>@Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
      View rootView = inflater.inflate(R.layout.fragment_call_for, container, false);
      TextView TXT = (TextView) rootView.findViewById(R.id.test);
      Bundle test = getArguments();
      if(test!=null){
          String d = test.getString("test", " "); 
          TXT.setText(d);
      }
      return rootView;
  }
  </code></pre>
  
  <p>The problem is the bundle is null. How can I fix this?</p>
  
  <p>This is my PHDetail FragmentActivity class :</p>
  
  <pre><code> @Override
          protected void onCreate(Bundle savedInstanceState) {
              // TODO Auto-generated method stub
              super.onCreate(savedInstanceState);
              setContentView(R.layout.phdetail);
              Intent intent = getIntent();
      if (intent != null) {
          String id = intent.getStringExtra("test");
      }
  
              // Initialization :
              viewPager = (ViewPager) findViewById(R.id.pager);
          actionBar = getActionBar();
          mAdapter  = new TabsPagerAdapter(getSupportFragmentManager());
  
          viewPager.setAdapter(mAdapter);
          actionBar.setHomeButtonEnabled(false);
          actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
  
          // Adding Tabs :
          for (String tab_name : tabs){
              actionBar.addTab(actionBar.newTab().setText(tab_name)
                          .setTabListener(this));
          }
          /**
           * on swiping the viewpager make respective tab selected
           * */
          viewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
  
              @Override
              public void onPageSelected(int position) {
                  // on changing the page
                  // make respected tab selected
                  actionBar.setSelectedNavigationItem(position);
              }
  
              @Override
              public void onPageScrolled(int arg0, float arg1, int arg2) {
              }
  
              @Override
              public void onPageScrollStateChanged(int arg0) {
              }
          });
      }
  
      @Override
      public void onTabReselected(Tab tab, FragmentTransaction ft) {
  
      }
  
      @Override
      public void onTabSelected(Tab tab, FragmentTransaction ft) {
          // on tab selected
          // show respected fragment view
  
          viewPager.setCurrentItem(tab.getPosition());
  
      }
  
      @Override
      public void onTabUnselected(Tab tab, FragmentTransaction ft) {
  
  
      }
  
  }
  </code></pre>