admin 管理员组

文章数量: 887033


2024年2月6日发(作者:linux下的虚拟机系统)

public class MainActivity extends AppCompatActivity { private EditText et_username; private EditText et_password; private EditText et_password2; private EditText et_mail; private Button btn_login; private Button btn_register; private CheckBox checkbox; @Override protected void onCreate(Bundle savedInstanceState) { te(savedInstanceState); setContentView(ty_main); Map userInfo = eInformation(this); if (userInfo != null) { et_t(("username")); et_t(("password")); } et_username =(EditText) findViewById(_username); et_password =(EditText) findViewById(_password); et_password2 =(EditText) findViewById(_password2); et_mail = (EditText) findViewById(_mail); checkbox = (CheckBox) findViewById(ox); btn_login =(Button) findViewById(_login); btn_register =(Button) findViewById(_register); btn_lickListener(new MyButton()); btn_lickListener(new MyButton()); } public class MyButton implements kListener{ @Override public void onClick(View view){ String username =et_t().toString().trim(); String password =et_t().toString().trim(); switch (()) { //当点击登录按钮时 case _login: if(y(username) || y(password)){ xt(,"密码或账号不能为空",_SHORT).show(); } else { if(ked()){ //保存密码的操作 } xt(,"登录成功",_SHORT).show(); Intent intent = new Intent(, ); startActivity(intent); } break; //当点击注册按钮事件时 case _register: Intent intent = new Intent(,); startActivity(intent); break; } } } }register_activity

android:id="@+id/reg_number2" android:layout_marginTop="5dp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/reg_number1" android:padding="10dp" android:text="密码:" android:textColor="#000" android:textSize="20dp" />


本文标签: 注册 点击 密码 按钮