I have researched on passing data from Activity to Activity. But I could not use the same method to pass to my fragment. How do I pass the data to my fragment?
The Code I am using is
    Intent i = new Intent(getApplicationContext(), NewActivity.class);
    i.putExtra("new_variable_name","value");
    startActivity(i);
and In the other activity
    Bundle extras = getIntent().getExtras();
    if (extras != null) {
        String value = extras.getString("new_variable_name");
    }
 
     
     
    