I'm trying to set an alarm for a particular date and time but so far I've been unsuccessful. As an experiment I'm trying to set it for 10:04am today like so:
Calendar cal = Calendar.getInstance();
// int currtYear = cal.get( Calendar.YEAR );
// int minute = cnvrtStrg( splitTime[1] ) - 5;
// int hour = cnvrtStrg( splitTime[0] );
cal.setTimeInMillis( System.currentTimeMillis() );
cal.clear();
cal.set( 2012, 4, 10, 10, 4 );
Intent intent = new Intent( passing_info.this, alarm_receiver.class );
sender = PendingIntent.getBroadcast( this, 0, intent, 0);
am = (AlarmManager)getSystemService( ALARM_SERVICE );
am.set( AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(),sender );
Toast.makeText( getApplicationContext(), "Alarm set",Toast.LENGTH_SHORT ).show();
Am I right in how I set it? And why isn't this doing anything? i.e. it doesn't go off ( the receiver class vibrates the phone)
Thanks
P.S. The toast message appears at that bottom