Update MainActivity.java

This commit is contained in:
joelalexpereira 2020-10-29 19:42:13 -04:00 committed by GitHub
parent 865f83977f
commit 441b7cd3b6

View file

@ -2,13 +2,43 @@ package com.example.capstone;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class MainActivity extends AppCompatActivity { public class MainActivity extends AppCompatActivity {
private Button login;
private Button sign;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main); setContentView(R.layout.activity_main);
login = (Button) findViewById(R.id.signin);
login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
openLogin();
}
});
sign = (Button) findViewById(R.id.signup);
sign.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
openSignup();
}
});
}
public void openLogin() {
Intent intent = new Intent(this, Login.class);
startActivity(intent);
}
public void openSignup() {
Intent intent2 = new Intent(this, signup.class);
startActivity(intent2);
} }
} }