-
Notifications
You must be signed in to change notification settings - Fork 1
/
AlarmActivity.java
55 lines (47 loc) · 1.56 KB
/
AlarmActivity.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
package com.example.abcd.alarmclock;
import android.app.AlarmManager;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import java.util.Calendar;
public class AlarmActivity extends AppCompatActivity {
AlarmManager alarmManager;
//private PendingIntent pendingIntent;
private static AlarmActivity inst;
private TextView alarmTextView;
Calendar calendar;
Button buttonTime;
public static AlarmActivity instance() {
return inst;
}
@Override
public void onStart() {
super.onStart();
inst = this;
}
public void next(View v){
Intent i = new Intent(AlarmActivity.this,WifiActivity.class);
startActivity(i);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_alarm);
alarmTextView = (TextView) findViewById(R.id.alarmText);
alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
buttonTime = (Button)findViewById(R.id.btnTime);
calendar = Calendar.getInstance();
}
public void setAlarmText(String alarmText) {
alarmTextView.setText(alarmText);
}
public void doSomething(View view){
if(view.getId() == R.id.btnTime){
Intent i = new Intent(this,TimePickerActivity.class);
startActivity(i);
}
}
}