Button loginbuttonbutton = (Button) findViewById(R.id.btnLogin);
loginbuttonbutton.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
if(inputEmail.getText().toString() == "EdEffort@ncat.edu" &&
inputPassword.getText().toString() == "Steelers") {
Intent myIntent = new Intent(view.getContext(),
Host_Setting_PageActivity.class);
startActivityForResult(myIntent, 0);
} else {
System.out.println("Username or password is incorrect");
}
}
});
那是我的代码,应用程序实际上启动了,但是每当我点击登录按钮时,应用程序就会关闭。