title: Set an Alarm from My application
body: <p>I want to create an alarm object from my application. I am writing a To-Do application which will have an option to set an Alarm on the phone.</p>
  
  <p>I wanna set the Date and Time and also the Label for the alarm.</p>
  
  <pre><code>Calendar c = Calendar.getInstance();
  c.setTimeInMillis(System.currentTimeMillis());
          c.clear();
          c.set(Calendar.YEAR, mYear);
          c.set(Calendar.MONTH, mMonth);
          c.set(Calendar.DAY_OF_MONTH, mDay);
          c.set(Calendar.HOUR, mHour);
          c.set(Calendar.MINUTE, mMinute);
          Intent activate = new Intent(this, alaram.class);
          AlarmManager alarams ;
          PendingIntent alarmIntent = PendingIntent.getBroadcast(this, 0, activate, 0);
          alarams = (AlarmManager) getSystemService(this.ALARM_SERVICE);
          alarams.set(AlarmManager.RTC_WAKEUP, c.getTimeInMillis(), alarmIntent);
  </code></pre>
  
  <p>I tried using the above code to set the alarm but am not able to. I dont get any error either :(</p>