title: Creating Android Notification every 15 minutes
body: <p>Hello I have a project in uni and I need to add notification to my application. Here's the code for the creation and starting the notification. Everything compile good however it does not display any notifications. 
   Alarm reciever - </p>
  
  <pre><code>package com.example.alex.daily_horoscope;
  
  import android.app.NotificationManager;
  import android.app.PendingIntent;
  import android.content.BroadcastReceiver;
  import android.content.Context;
  import android.content.Intent;
  import android.support.v4.app.NotificationCompat;
  
  public class AlarmReceiver extends BroadcastReceiver {
  public AlarmReceiver() {
  }
  
  @Override
  public void onReceive(Context context, Intent intent) {
  // fire notification
  
      // Gets an instance of the NotificationManager service
      final NotificationManager mgr = (NotificationManager)     context.getSystemService(Context.NOTIFICATION_SERVICE);
      NotificationCompat.Builder mBuilder =
              new NotificationCompat.Builder(context)
                      .setSmallIcon(R.mipmap.ic_launcher)
                      .setContentTitle(context.getResources().getText(R.string.notification))
                      .setContentText("You have new horoscope");
      // This pending intent will open after notification click
      Intent resultIntent = new Intent(context, MainActivity.class);
      PendingIntent resultPendingIntent =
              PendingIntent.getActivity(context, 0, resultIntent,PendingIntent.FLAG_UPDATE_CURRENT);
  
      mBuilder.setContentIntent(resultPendingIntent);
      mBuilder.setAutoCancel(true);
      // Sets an ID for the notification
      int mNotificationId = 001;
      // Builds the notification and issues it.
      mgr.notify(mNotificationId, mBuilder.build());
  }
  }
  </code></pre>
  
  <p>Service starter</p>
  
  <pre><code>package com.example.alex.daily_horoscope;
  import android.app.AlarmManager;
  import android.app.PendingIntent;
  import android.content.BroadcastReceiver;
  import android.content.Context;
  import android.content.Intent;
  import android.os.SystemClock;
  
  public class ServiceStarter extends BroadcastReceiver {
  public final static int ALARM_ID = 12345;
  
  @Override
  public void onReceive(Context context, Intent intent) {
      System.out.println("Start service");
      if (intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) {
          System.out.println("Boot completed");
          // start the alarm on phone reboot
          Intent intentAlarm = new Intent(context, AlarmReceiver.class);
          System.out.println("calling Alarm receiver ");
          AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
          //set the notification to repeat every fifteen minutes
          long startTime = 1*60*1000; // 2 min
          // set unique id to the pending item, so we can call it when needed
          PendingIntent pi = PendingIntent.getBroadcast(context, ALARM_ID, intentAlarm, PendingIntent.FLAG_UPDATE_CURRENT);
          alarmManager.setInexactRepeating(AlarmManager.RTC, SystemClock.elapsedRealtime() +
                  startTime, AlarmManager.INTERVAL_FIFTEEN_MINUTES, pi);
  
      }
  
  }
  
  }
  </code></pre>