|
|
|
@ -5,6 +5,7 @@ import android.view.View;
|
|
|
|
|
import android.widget.Button;
|
|
|
|
|
import android.widget.EditText;
|
|
|
|
|
|
|
|
|
|
import androidx.appcompat.app.AlertDialog;
|
|
|
|
|
import androidx.appcompat.app.AppCompatActivity;
|
|
|
|
|
|
|
|
|
|
import Schema.OperaSchema;
|
|
|
|
@ -32,7 +33,18 @@ public class LoginActivity extends AppCompatActivity {
|
|
|
|
|
String password=password_edit.getText().toString();
|
|
|
|
|
//调用数据库类中的方法进行登录
|
|
|
|
|
boolean isLogin= OperaSchema.longin(tel,password);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 登陆成功,返回上一个界面,即个人中心界面,刷新个人中心界面
|
|
|
|
|
* 即,改变登录按钮为欢迎按钮
|
|
|
|
|
*/
|
|
|
|
|
if(isLogin) {
|
|
|
|
|
finish();//返回个人中心Activity
|
|
|
|
|
}else{//登陆失败提醒
|
|
|
|
|
AlertDialog.Builder builder = new AlertDialog.Builder(LoginActivity.this);
|
|
|
|
|
builder.setTitle("登陆提醒");// 设置标题
|
|
|
|
|
builder.setMessage("登陆失败");// 为对话框设置内容
|
|
|
|
|
builder.create().show();// 使用show()方法显示对话框
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|