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.
37 lines
1.1 KiB
37 lines
1.1 KiB
9 months ago
|
package com.example.meetyou;
|
||
|
|
||
|
import androidx.appcompat.app.AppCompatActivity;
|
||
|
|
||
|
import android.content.Intent;
|
||
|
import android.os.Bundle;
|
||
|
import android.view.View;
|
||
|
import android.widget.Button;
|
||
|
|
||
|
public class MainActivity extends AppCompatActivity {
|
||
|
|
||
|
@Override
|
||
|
protected void onCreate(Bundle savedInstanceState) {
|
||
|
super.onCreate(savedInstanceState);
|
||
|
setContentView(R.layout.activity_main);//xml文件和java文件一一对应9,
|
||
|
Button button1 = (Button)findViewById(R.id.register);
|
||
|
button1.setOnClickListener(new View.OnClickListener()
|
||
|
{
|
||
|
@Override
|
||
|
public void onClick(View view)
|
||
|
{
|
||
|
Intent intent = new Intent(MainActivity.this,register.class);
|
||
|
startActivity(intent);
|
||
|
}
|
||
|
});
|
||
|
Button button2 = (Button)findViewById(R.id.login);
|
||
|
button2.setOnClickListener(new View.OnClickListener()
|
||
|
{
|
||
|
@Override
|
||
|
public void onClick(View view)
|
||
|
{
|
||
|
Intent intent = new Intent(MainActivity.this,login.class);
|
||
|
startActivity(intent);
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
}
|