show a notification on a particular date and time

后端 未结 1 677
迷失自我
迷失自我 2021-01-14 15:30

I need to show a notification on a particular date and time (27-06-2015 13:00). Initially I am showing a toast message. I have created a broadcast receiver to do that. I am

相关标签:
1条回答
  • 2021-01-14 16:17

    Every thing looks clear in your code may be it is the problem of Calendar obj that you have initialized.

    Once try as follows,

    Calendar cal = Calendar.getInstance();
    cal.setTimeInMillis(System.currentTimeMillis());
    cal.clear();
    cal.set(2015,5,27,13,00); 
    

    And to set

    alarmManager1.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), pendingIntent1);
    

    Hope this will helps you.

    0 讨论(0)
提交回复
热议问题