title: Create Notification with BroadcastReceiver
body: <p>I tried to create a Notification with this Code:</p>
  
  <pre><code>private void setNotificationAlarm(Context context) 
  {
      Intent intent = new Intent(getApplicationContext() , MyNotification.class);
      PendingIntent pendingIntent  = PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT);  
  
      AlarmManager am = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
      am.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis(), 1000 , pendingIntent);
      Log.d("ME", "Alarm started");
  }
  
  public class MyNotification extends BroadcastReceiver
  {
      @Override
      public void onReceive(Context context, Intent intent) 
      {
          Log.d("ME", "Notification started");
  
          NotificationCompat.Builder mBuilder =
              new NotificationCompat.Builder(context)
              .setSmallIcon(R.drawable.ic_launcher)
              .setContentTitle("My notification")
              .setContentText("Hello World!");
  
          NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
          mNotificationManager.notify(1, mBuilder.build());
      }
  }
  </code></pre>
  
  <p>And here my Mainfest declaration:</p>
  
  <pre><code>&lt;receiver
      android:name=".MyNotification"
      android:enabled="true"
      android:exported="false" &gt;
  &lt;/receiver&gt;
  </code></pre>
  
  <p>My problem now is, that the alarm is generated but the Notification isn't displayed. The BroadcastReceiver is declared in the mainfest file and there are no compiler or runtime errors.</p>
  
  <p>My second problem is that <code>setLatestEventInfo</code> and <code>new Notification</code> Contructor are deprecated. What can I use instead of it?</p>