Possible Duplicate:
How do I compare strings in Java?
i have 2 class, let say a.class and b.class
and i want to send array from a to b using intent, in a.class
Intent intent = new Intent(this,b.class);
intent.putExtra("stringtext", "1");
startActivity(intent);
and in b.class i catch the intent value with this
Intent it = getIntent();
String id = it.getStringExtra("stringtext");
when i try to print id, it give me "1" but when i'm using id in if clause i didnt work, i try this
if(id=="1")
{
teks.setText("its one");
}
else
{
teks.setText("not one";
}
how could this happend?