Intent i=new Intent(TimeSetActivity.this,AlarmReceiver.class); PendingIntent pi = PendingIntent.getBroadcast(TimeSetActivity.this, Integer.valueOf(id) , i, 0); //通过getBroadcast第二个参数区分闹钟,将查询得到的note的ID值作为第二个参数。 AlarmManager am = (AlarmManager) getSystemService(Activity.ALARM_SERVICE); am.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), pi);//设置闹铃 Intent i=new Intent(TimeSetActivity.this,AlarmReceiver.class); PendingIntent pi = PendingIntent.getBroadcast(TimeSetActivity.this, Integer.valueOf(id) , i, 0); am.cancel(pi);//取消闹钟