2012-10-18 76 views
0

我創建了一個通知,假定「我的考試」。在指定日期之前在Android中的通知

我想顯示設定日期

我存儲日期在數據庫中的前3天提醒通知希望將其與當前的日期和顯示通知比較

任何幫助將不勝感激

謝謝...

+0

你做了什麼? –

+0

它的工作就像這樣對我來說:當我從datepicker類似int day = picker.getDayOfMonth(); \t int month = picker.getMonth(); \t int year = picker.getYear();我將接受一個值爲3的int變量,而我';;將day pass值減去這樣的日曆日曆c = Calendar.getInstance(); \t c.set(year,month,day);並呼籲通知它工作正常,但現在的問題是,如果我的日期是月的第一次減去邏輯不會工作任何幫助將不勝感激:) –

回答

0

要生成3天前是一個特定日期的日期試試這個:

Calendar c = Calendar.getInstance(); 
c.set(year, month, day); // Set the calendar NOTE: this will not change the hour, minute, second 
c.add(Calendar.DAY_OF_YEAR, -3); // Roll the calendar back 3 days 
相關問題