-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathManageSystemActivity.java
More file actions
53 lines (42 loc) · 1.6 KB
/
ManageSystemActivity.java
File metadata and controls
53 lines (42 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package com.example.project2part3;
import android.content.Intent;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
public class ManageSystemActivity extends AppCompatActivity implements View.OnClickListener {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_managesystem);
View CreateAccountButton = findViewById(R.id.SubmitButton2);
CreateAccountButton.setOnClickListener(this);
}
public void onClick(View V) {
EditText uinput;
String userin;
EditText pinput;
String passin;
TextView result;
if (V.getId() == R.id.SubmitButton2) {
uinput = findViewById(R.id.usernametext2);
userin = uinput.getText().toString();
pinput = findViewById(R.id.passwordtext2);
passin = pinput.getText().toString();
result = findViewById(R.id.view3);
if(userin.matches("")||passin.matches("")){
result.setText("Please do not leave any fields blank.");
}
else if(userin.matches("!admin2") && passin.matches("!admin2")){
Intent i = new Intent(this, TransactionActivity.class);
startActivity(i);
}
else{
result.setText("This sign-in is only for admin accounts.");
}
}
}
}