title: Passing data from one fragment to another
body: <p>I have an Activity with two fragments and I need to pass a string from FragmentA to FragmentB.</p>
  
  <p>To pass the data, I have this in my FragmentA:</p>
  
  <pre><code>    Intent intent = new Intent(getActivity(), FragmentB.class);
      intent.putExtra("name", "Mark");
      startActivity(intent);
  </code></pre>
  
  <p>And to get the data, I did this in FragmentB</p>
  
  <pre><code>    Intent intent = getActivity().getIntent();
      Bundle b = intent.getExtras();
  
      if(b!=null)
      {
          String name =(String) b.get("name");
          nameTextView.setText(name);
      }
  </code></pre>
  
  <p>But this is not working. Is there a specific way to pass a string from one fragment to another fragment?</p>