title: Create notifications every minute
body: <p>I want to create notifications every minute, I put code from another question about notification every 48 hour but app is working and notifications do not get created. What am I doing wrong?
  ShowNotification:</p>
  
  <pre><code>public class ShowNotification extends Service {
  
      private final static String TAG = "ShowNotification";
  
      @Override
      public void onCreate() {
          super.onCreate();
  
          Intent mainIntent = new Intent(this, MainActivity.class);
  
          NotificationManager notificationManager
                  = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);
  
          Notification noti = new NotificationCompat.Builder(this)
                  .setAutoCancel(true)
                  .setContentIntent(PendingIntent.getActivity(this, 0, mainIntent,
                          PendingIntent.FLAG_UPDATE_CURRENT))
                  .setContentTitle("New SMS " + System.currentTimeMillis())
                  .setContentText("Hello")
                  .setDefaults(Notification.DEFAULT_ALL)
                  .setSmallIcon(R.drawable.ic_email_white_24dp)
                  .setTicker("ticker message")
                  .setWhen(System.currentTimeMillis())
                  .build();
  
          notificationManager.notify(0, noti);
  
          Log.i(TAG, "Notification created");
      }
  
      @Override
      public IBinder onBind(Intent intent) {
          // TODO Auto-generated method stub
          return null;
      }
  }
  </code></pre>
  
  <p>MainActivity:</p>
  
  <pre><code>context = MainActivity.this;
          Intent notificationIntent = new Intent(context, ShowNotification.class);
          PendingIntent contentIntent = PendingIntent.getService(context, 0, notificationIntent,
                  PendingIntent.FLAG_CANCEL_CURRENT);
  
          AlarmManager am = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
          am.cancel(contentIntent);
          am.setInexactRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis()
                  , 1000*60, contentIntent);
  </code></pre>