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(\
We can do it by simple means:
In FirstActivity:
Intent intent = new Intent(FirstActivity.this, SecondActivity.class);
intent.putExtra("uid", uid.toString());
intent.putExtra("pwd", pwd.toString());
startActivity(intent);
In SecondActivity:
try {
Intent intent = getIntent();
String uid = intent.getStringExtra("uid");
String pwd = intent.getStringExtra("pwd");
} catch (Exception e) {
e.printStackTrace();
Log.e("getStringExtra_EX", e + "");
}