title: Errors when wanting to create a notification in OnReceive()
body: <p>I want to display a notification and repeat it every period. I read how to make that and i maked that code in the class that extends Broadcast Receiver:</p>
  
  <pre><code>public class OnAlarmReceiver extends BroadcastReceiver{
      @Override
       public void onReceive(Context context, Intent intent) {
  
  
          String ns = Context.NOTIFICATION_SERVICE;
          NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);
  
          int icon = R.drawable.icon;
          CharSequence tickerText = "Votre vidange approche";
          long when = System.currentTimeMillis();
  
          Notification notification = new Notification(icon, tickerText, when);
  
  
          CharSequence contentTitle = "Notification";
          CharSequence contentText = "Vérifier votre kilométrage";
          Intent notificationIntent = new Intent(this, Acceuil.class);
          PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
  
          notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
  
          final int HELLO_ID = 1;
  
          mNotificationManager.notify(HELLO_ID, notification);
       }
  </code></pre>
  
  <p>However, i don't know why i have this errors:</p>
  
  <pre><code>The method getSystemService(String) is undefined for the type OnAlarmReceiverThe constructor Intent(OnAlarmReceiver, Class&lt;Acceuil&gt;) is undefined
  The method getActivity(Context, int, Intent, int) in the type PendingIntent is not applicable for the arguments (OnAlarmReceiver, int, Intent, int)
  </code></pre>
  
  <p>In the other activity i guess that i have to do this:</p>
  
  <pre><code>public void notifs() {
          AlarmManager mgr=(AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
          Intent i=new Intent(context, OnAlarmReceiver.class);
          PendingIntent pi=PendingIntent.getBroadcast(context, 0, i, 0);
  
          mgr.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime(), 1800000, pi);
      }
  </code></pre>
  
  <p>What's the problem here ?
  Thank you very much.</p>