This is what I am doing
FIRST ACTIVITY
public void onClick(View v) {
Intent intent = new Intent(TeamsActivity.this,PakistaniPlayers.class).putExtra("StringName","hello");
startActivity(intent);
}
SECOND ACTIVITY
if(getIntent().getStringExtra("StringName")=="hello")
{
TextView t=(TextView) findViewById(R.id.textView1);
t.setText(getIntent().getStringExtra("StringName"));
}
Now the code inside the if statement doesn't run but if I run the statements inside the if statement separately I get hello displayed.