Android programming use of alarmmanger <p>I want to show toast at a specific time using AlarmManger but my toast is not shown at given time? Help me. My code is as follows:</p> <pre><code>private void startAlarm() { Calendar cal=Calendar.getInstance(); cal.set(Calendar.DAY_OF_MONTH,9); cal.set(Calendar.MONTH,7); cal.set(Calendar.YEAR,2015); cal.set(Calendar.HOUR_OF_DAY,2); cal.set(Calendar.MINUTE,55); cal.set(Calendar.AM_PM,Calendar.PM); Intent intent = new Intent(this, WelcomActivity.class); PendingIntent pendingIntent = PendingIntent.getBroadcast(this.getApplicationContext(), 0, intent, 0); AlarmManager alarmManager = (AlarmManager)getApplicationContext().getSystemService(ALARM_SERVICE); alarmManager.setInexactRepeating(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), AlarmManager.INTERVAL_DAY, pendingIntent); Toast.makeText(this, "Alarm worked.", Toast.LENGTH_LONG).show(); } </code></pre>