How can I send data from one activity (intent) to another?
I use this code to send data:
Intent i=new Intent(context,SendMessage.class);
i.putExtra(\
String value = "Hello World!";
Intent intent = new Intent(getApplicationContext(), NewActivity.class);
intent.putExtra("sample_name", value);
startActivity(intent);
String value;
Bundle bundle = getIntent().getExtras();
if (bundle != null) {
value = bundle.getString("sample_name");
}