Try to launch notification in one hour

This commit is contained in:
Jacques Foucry 2016-11-06 22:25:13 +01:00
parent 0b1da8a65e
commit 74d861b1e4

View file

@ -50,6 +50,7 @@ import java.util.logging.Handler;
import static net.foucry.pilldroid.NotificationPublisher.NOTIFICATION_ID;
import static net.foucry.pilldroid.UtilDate.date2String;
import static net.foucry.pilldroid.UtilDate.tomorrowAtNoonInMillis;
import static net.foucry.pilldroid.Utils.doubleRandomInclusive;
/**
@ -314,8 +315,8 @@ public class MedicamentListActivity extends AppCompatActivity {
dateSchedule = dateAlerte.getTime(); // If dateAlerte > now we use dateAlerte as scheduleDate
}
// int between2DateInMillis = (int) (tomorrow.getTime() - now.getTime());
scheduleNotification(getNotification(getString(R.string.notification_text)),3600000);
long delay = (long) (dateSchedule - now.getTime());
scheduleNotification(getNotification(getString(R.string.notification_text)),delay);
Log.d(TAG, "Notification scheduled for "+ UtilDate.convertDate(dateSchedule));
}