main
Qiang-志 9 months ago
parent 4fb95c09fb
commit 72c692fb6c

@ -0,0 +1,37 @@
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);
}
});
}
}
Loading…
Cancel
Save