私はその日の特定の時刻にアラームを設定しようとしています:例えば:20:15 これは私と一緒に作業していても消えないコードです午前20時15分今日の特定の時刻にアラームを設定する
Intent intent = new Intent(AlarmActivity.this, MyBroadcastReceiver.class);
intent.putExtra("Hekma", "One better than none");
PendingIntent pintent = PendingIntent.getService(AlarmActivity.this, 0,intent, 0);
AlarmManager alarm = (AlarmManager)getSystemService(ALARM_SERVICE);
Calendar cal = Calendar.getInstance();
cal.set(Calendar.HOUR_OF_DAY, 20);
cal.set(Calendar.MINUTE, 15);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
alarm.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), pintent);
はそれが何もちょうどアラームの私が持っている私のコードに再びそれを比較し、[OK]を –
が起こっていない動作しませんでしたこれを試してみました。私が見ることができる唯一の他の違いは、 "PendingIntent.getService(....;")があるということです。 –
私はPendingIntent.getBroadcast(... –