mirror of
https://github.com/jfoucry/Pilldroid.git
synced 2024-11-09 23:41:08 +01:00
Add isScheduled method to avoid schedule notification on each onPause of DrugListActivity.
This commit is contained in:
parent
8879c6a2ce
commit
3199a0abdc
1 changed files with 6 additions and 0 deletions
|
@ -148,4 +148,10 @@ public class AlarmReceiver extends BroadcastReceiver {
|
|||
|
||||
if (BuildConfig.DEBUG) { Toast.makeText(context, "Alarm scheduled for " + UtilDate.convertDate(calendar.getTimeInMillis()), Toast.LENGTH_SHORT).show(); }
|
||||
}
|
||||
|
||||
public static Boolean isAlarmScheduled(Context context) {
|
||||
AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
|
||||
|
||||
return alarmManager.getNextAlarmClock() != null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue