package xuyan.alarmmanager.test;
import java.util.Calendar;
import android.app.Activity;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.app.Service;
import android.app.TimePickerDialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TimePicker;
import android.widget.Toast;
public class AlarmManagerActivity extends Activity {
/** Called when the activity is first created. */
Button settime;
AlarmManager alarmmanager;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
alarmmanager=(AlarmManager)getSystemService(Service.ALARM_SERVICE);
settime=(Button)this.findViewById(R.id.button1);
settime.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-g
Android 闹钟源码
最新推荐文章于 2021-05-25 22:52:11 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)