0
我正在設置2小時的間隔報警。它的工作非常完美,但問題是,在設置時會觸發警報。 設置休息時沒有必要觸發報警。如何在設置時避免報警觸發?
Intent _myIntent = new Intent(activity, MyReceiverStartPush.class);
_myIntent.putExtra("msg", "Feed");
PendingIntent _myPendingIntent = PendingIntent.getBroadcast(
activity, 0, _myIntent, 0);
AlarmManager _myAlarmManager = (AlarmManager) activity
.getSystemService(Service.ALARM_SERVICE);
_myAlarmManager.setRepeating(AlarmManager.RTC_WAKEUP,
System.currentTimeMillis(), (AlarmManager.INTERVAL_HOUR)
* 2, _myPendingIntent);
是的,工作過。謝謝 – user3819810