title: How to send data from fragment to another activity?
body: <p>I need to send data from Fragment to another activity</p>
  
  <p>I am using this code in my LoadsFragment under HomeActivity</p>
  
  <pre><code>Intent intent = new Intent(activity, LoadActivity.class);
  intent.putExtra("loadsPosition",position);
  activity.startActivity(intent);
  </code></pre>
  
  <p>in another activity(LoadActivity) to receive data</p>
  
  <pre><code>Intent intent=getIntent();    
  String loadsPosition = intent.getStringExtra("loadsPosition");
  </code></pre>
  
  <p>but intent has no Extras</p>
  
  <p>see the screenshots below</p>
  
  <p><a href="https://i.stack.imgur.com/Bm0dS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Bm0dS.png" alt="From fragment sending intent"></a><a href="https://i.stack.imgur.com/FfNXg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FfNXg.png" alt="in second activity getting extras"></a><a href="https://i.stack.imgur.com/H5p2E.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/H5p2E.png" alt="enter image description here"></a></p>