intent.putExtra is used to send information between activities. Here is an example
Use this to βputβ a file
Intent i = new Intent(FirstScreen.this, SecondScreen.class); String keyIdentifer = null; i.putExtra("STRING_I_NEED", strName);
Then, to get the value, try something like:
String newString if (savedInstanceState == null) { extras = getIntent().getExtras(); if(extras == null) { newString= null; } else { newString= extras.getString("STRING_I_NEED"); } } else { newString= (String) savedInstanceState.getSerializable("STRING_I_NEED"); }
source share