title: How can i set an alarm with AlarmManager set()
body: <p>I have tried to set an alarm in my android app. But it failed. I have read some tutorials but they don't work for me, i don't see where is my mistake.</p>
  
  <p>Here is my code: </p>
  
  <p>Manifest : </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.byethost6.jessy_barthelemy.planificate"&gt;
  
      &lt;uses-permission android:name="com.android.alarm.permission.SET_ALARM"/&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:supportsRtl="true"
          android:theme="@style/AppTheme"&gt;
  
  
          &lt;activity android:name=".CreateTask"&gt;&lt;/activity&gt;
  
          &lt;receiver android:name="com.byethost6.jessy_barthelemy.planificate.HourReceiver" android:process=":remote"/&gt;
  
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>I set the alarm like this : </p>
  
  <pre><code>        AlarmManager alarmManager;
          PendingIntent alarmIntent;
          alarmManager = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
          Intent intent = new Intent(context, HourReceiver.class);
          alarmIntent = PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_ONE_SHOT);
  
          Calendar calendar = Calendar.getInstance();
  
          calendar.set(Calendar.HOUR_OF_DAY, hours);
          calendar.set(Calendar.MINUTE, minutes);
  
  
          alarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), alarmIntent);
          Toast.makeText(context, "Alarm set", Toast.LENGTH_SHORT).show();
  </code></pre>
  
  <p>And this is my broadcast receiver : </p>
  
  <pre><code>package com.byethost6.jessy_barthelemy.planificate;
  
  import android.content.BroadcastReceiver;
  import android.content.Context;
  import android.content.Intent;
  import android.widget.Toast;
  
  import com.byethost6.jessy_barthelemy.planificate.enumeration.TriggerEnum;
  import com.byethost6.jessy_barthelemy.planificate.helper.Task;
  
  public class HourReceiver extends BroadcastReceiver{
      @Override
      public void onReceive(Context context, Intent intent) {
          Toast.makeText(context, "ALARM TRIGGERED", Toast.LENGTH_LONG).show();
      }
  }
  </code></pre>
  
  <p>Could you please help me? :)</p>