I am a beginner working on an android application in which i am stuck at comparing the value taken from previous activity and a variable initialized with the same value as the previous one.
This is the mainactivity code
String string="value";
reference.setText(string);//i am setting the value manually to Edittext
Intent i = new Intent(this,next.class);
String getrec=reference.getText().toString();
Bundle bundle = new Bundle();
bundle.putString("VALUER", getrec);
System.out.print(getrec);
i.putExtras(bundle);
startActivity(i);
finish();
This the next.class code
int i;
Bundle bundle = getIntent().getExtras();
String venName = bundle.getString("VALUER");
if (venName=="value") {
i=1;
...
}
And this if condition is not getting executed. Please help.