-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTask 3.java
More file actions
31 lines (25 loc) · 1.06 KB
/
Task 3.java
File metadata and controls
31 lines (25 loc) · 1.06 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
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
public class MainActivity extends AppCompatActivity {
private TextView timeTextView;
private Button setAlarmButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
timeTextView = findViewById(R.id.timeTextView);
setAlarmButton = findViewById(R.id.setAlarmButton);
// Set onClickListener for setAlarmButton to open the alarm setting screen
setAlarmButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Open alarm setting screen or dialog
// You can use Intent to open a new activity or a dialog fragment
}
});
// Other logic for displaying current time, managing alarms, snooze, dismiss, etc.
}
}