I investigated the transfer of data from Activity to Activity. But I could not use the same method to go to my fragment. How to transfer data to my fragment?
The code I use
Intent i = new Intent(getApplicationContext(), NewActivity.class); i.putExtra("new_variable_name","value"); startActivity(i);
and in other activities
Bundle extras = getIntent().getExtras(); if (extras != null) { String value = extras.getString("new_variable_name"); }
source share