Browse Source

Notifications des dons dans les deux semaines prochaines semaines

tags/release-v3.0
Schoumi 4 years ago
parent
commit
e453036e67

+ 2
- 0
app/src/main/java/fr/mobdev/blooddonation/service/AlarmReceiver.java View File

@@ -160,6 +160,7 @@ public class AlarmReceiver extends BroadcastReceiver {
cal.set(Calendar.MILLISECOND, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.DAY_OF_YEAR,cal.get(Calendar.DAY_OF_YEAR)+14);
List<BloodSite> sites = Database.getInstance(context).getBloodSites(-1);
checkForProximity(sites, context);
checkForDate(sites, context);
@@ -167,6 +168,7 @@ public class AlarmReceiver extends BroadcastReceiver {
List<Long> newNotifications = new ArrayList<Long>();
for(BloodSite site : sites)
{
if(site.getDate().compareTo(cal) < 0)
newNotifications.add(site.getDbId());
}


Loading…
Cancel
Save