You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.8 KiB
52 lines
1.8 KiB
package com.demo.logining;
|
|
|
|
import androidx.appcompat.app.AppCompatActivity;
|
|
|
|
import android.content.Intent;
|
|
import android.os.Bundle;
|
|
import android.view.View;
|
|
import android.widget.Button;
|
|
import android.widget.EditText;
|
|
import android.widget.Toast;
|
|
|
|
public class MainActivity extends AppCompatActivity {
|
|
|
|
@Override
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
EditText Accm = findViewById(R.id.accM);
|
|
EditText Pswm = findViewById(R.id.pasM);
|
|
super.onCreate(savedInstanceState);
|
|
setContentView(R.layout.activity_main);
|
|
Button button1 = findViewById(R.id.button1);
|
|
button1.setOnClickListener(new View.OnClickListener() {
|
|
@Override
|
|
public void onClick(View view) {
|
|
if(!Register1Activity.isRegister)
|
|
Toast.makeText(MainActivity.this,"账号不存在,请先注册",Toast.LENGTH_LONG).show();
|
|
else {
|
|
Toast.makeText(MainActivity.this, "登录成功!!!", Toast.LENGTH_LONG).show();
|
|
Intent i = new Intent(MainActivity.this, MyInfor1Activity.class);
|
|
startActivity(i);
|
|
}
|
|
}
|
|
});
|
|
|
|
// if(Register1Activity.isRegister){
|
|
// Intent intent=this.getIntent();
|
|
// Bundle bundle=intent.getExtras();
|
|
// String acc = bundle.getString("acc");
|
|
// String psw = bundle.getString("password");
|
|
// Accm.setText(acc);
|
|
// Pswm.setText(psw);
|
|
// }
|
|
|
|
Button button2 = findViewById(R.id.button2);
|
|
button2.setOnClickListener(new View.OnClickListener() {
|
|
@Override
|
|
public void onClick(View view) {
|
|
Intent i =new Intent(MainActivity.this,Register1Activity.class);
|
|
startActivity(i);
|
|
}
|
|
});
|
|
}
|
|
} |