-
Notifications
You must be signed in to change notification settings - Fork 1
/
MainActivity.java
61 lines (48 loc) · 1.98 KB
/
MainActivity.java
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
54
55
56
57
58
59
60
61
package com.example.loginregister;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
com.example.loginregister.database_helper myDb;
Button blogin;
Button bRegister;
Button bHospitalNearMe;
EditText etName, etUsername, etBloodGroup;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
myDb = new com.example.loginregister.database_helper(this);
etUsername = (EditText) findViewById(R.id.etUsername);
etName = (EditText) findViewById(R.id.etName);
blogin = (Button) findViewById(R.id.blogin);
bRegister = (Button) findViewById(R.id.bRegister);
bHospitalNearMe = (Button) findViewById(R.id.bHospitalsNearMe);
blogin.setOnClickListener(this);
bRegister.setOnClickListener(this);
bHospitalNearMe.setOnClickListener(this);
}
@Override
public void onClick(View v){
switch (v.getId()){
case R.id.blogin:
Intent intent = new Intent(this, com.example.loginregister.Login.class);
startActivity(intent);
break;
case R.id.bRegister:
Intent intent1 = new Intent(this, com.example.loginregister.Register.class);
startActivity(intent1);
break;
case R.id.bHospitalsNearMe:
Intent intent2 = new Intent(this, com.example.loginregister.MapsActivity.class);
startActivity(intent2);
break;
}
}
}