title: Notification null when app closed
body: <p>I have problem with my program. I set: .setContentText(powiadomienie). It is working, but only when app is open. When I close app it show null notification. Can you tell me what I am doing wrong? Thanks and have a nice day!</p>
  
  <hr>
  
  <pre><code>nazwaLeku = (EditText) findViewById(R.id.editText);
  </code></pre>
  
  <hr>
  
  <pre><code>    dodaj.setOnClickListener(new View.OnClickListener() {
          @RequiresApi(api = Build.VERSION_CODES.KITKAT)
          @Override
          public void onClick(View view) {
  
              NotificationReceiver.xd(nazwaLeku.getText().toString());
  
              if (nazwaLeku.getText().length() &gt; 0 &amp;&amp; ileDni.getText().length() &gt; 0) {
  
                  Calendar cal = Calendar.getInstance();
                  cal.set(year, month-1, day, hour, minutes, 0);
  
                  Intent intx = new Intent(getApplicationContext(), NotificationReceiver.class);
  
                  PendingIntent pendingIntent = PendingIntent.getBroadcast(getApplicationContext(), 100, intx, PendingIntent.FLAG_UPDATE_CURRENT);
  
                  AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
                  alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), AlarmManager.INTERVAL_DAY, pendingIntent);
  
              }
          }
      });
  </code></pre>
  
  <hr>
  
  <pre><code>public class NotificationReceiver extends BroadcastReceiver{
  
      static String powiadomienie;
  
      @Override
      public void onReceive(Context context, Intent intent) {
          NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
  
          Intent repeating_intent = new Intent(context, RepeatingActivity.class);
          repeating_intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
  
          PendingIntent pendingIntent = PendingIntent.getActivity(context, 100, repeating_intent, PendingIntent.FLAG_UPDATE_CURRENT);
  
          Uri alarmSound = Uri.parse("android.resource://com.example.kuba.dsadsax/" + R.raw.audio);
  
          NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
                  .setContentIntent(pendingIntent)
                  .setSmallIcon(R.drawable.logo)
                  .setContentTitle("Weź pigułke")
                  .setContentText(powiadomienie)
                  .setSound(alarmSound)
                  .setOnlyAlertOnce(true)
                  .setAutoCancel(true);
          notificationManager.notify(100, builder.build());
  
  
      }
  
      public static void xd(String lek) {
          powiadomienie = lek;
      }
  }
  </code></pre>