Ok so im trying to make a app that opens a toast saying you are incorrect or correct although im having some trouble with my if statements can someone please tell me what the problem is
Code:
public class IfActivity extends Activity {
Button GO;
EditText TEXT;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
GO = (Button) findViewById(R.id.go);
TEXT = (EditText) findViewById(R.id.Textin);
GO.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
// TODO Auto-generated method stub
if ("hello".equals(TEXT)) {
Toast andEggs = Toast.makeText(IfActivity.this,
"PASSWORD IS CORRECT", Toast.LENGTH_SHORT);
andEggs.show();
} else {
Toast andEggs = Toast.makeText(IfActivity.this,
"PASSWORD IS INCORRECT", Toast.LENGTH_SHORT);
andEggs.show();
}
}
});
}
}