title: AlarmManager when the phone is turned off - ANDROID
body: <p>I'm doing an alarm System but i've a problem when the phone is turned off.. The alarm doesn't work..</p>
  
  <p>I'm setting de alarm as follows:</p>
  
  <pre><code>    public void doIntents(Context context, long milis, Tratam trat){
      cal=Calendar.getInstance();
      alarmManager = (AlarmManager) context.getSystemService(Service.ALARM_SERVICE);
  
      cal.setTimeInMillis(milis);
      Intent intent = new Intent(context, OnAlarmReceiver.class);
  
  
      pendingIntent = PendingIntent.getBroadcast(context, trat.getId(), intent, PendingIntent.FLAG_UPDATE_CURRENT);
      alarmManager.set(AlarmManager.RTC_WAKEUP,milis ,pendingIntent);
  
  }
  </code></pre>
  
  <p>The Alarm works Ok when the phone is turned on..</p>
  
  <p>What can I do?</p>
  
  <p>Thank you!</p>