-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainActivity.java
More file actions
41 lines (36 loc) · 1.36 KB
/
MainActivity.java
File metadata and controls
41 lines (36 loc) · 1.36 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
package com.example.project2part3;
import androidx.appcompat.app.AppCompatActivity;
import android.view.View.OnClickListener;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
public class MainActivity extends AppCompatActivity implements OnClickListener {
private Librarydb ldb;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
View CreateAccountButton = findViewById(R.id.button);
CreateAccountButton.setOnClickListener(this);
View PlaceHoldButton = findViewById(R.id.button2);
PlaceHoldButton.setOnClickListener(this);
View ManageSystemButton = findViewById(R.id.button3);
ManageSystemButton.setOnClickListener(this);
ldb = Librarydb.getInstance(this);
ldb.populateInitialData();
}
public void onClick(View V){
if(V.getId() == R.id.button){
Intent i = new Intent(this, CreateAccountActivity.class);
startActivity(i);
}
if(V.getId() == R.id.button2){
Intent i = new Intent(this, PlaceHoldActivity.class);
startActivity(i);
}
if(V.getId() == R.id.button3){
Intent i = new Intent(this, ManageSystemActivity.class);
startActivity(i);
}
}
}