title: Bad notification for startForeground
body: <p>I created a service. And I started this service foreground, but when I lunch my application, An application is crashed. I added startServiceOreoCondition I read about this but it does not help me</p>
  
  <pre><code>@Override
  public void onCreate() {
  
      mdb = ManagerDB.getInstance(getApplicationContext(), "name");
      context = getApplicationContext();
  
      if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.O) {
          NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
          nm.createNotificationChannel(new NotificationChannel(NOTIFICATION_CHANNEL_ID_SERVICE, "*****", NotificationManager.IMPORTANCE_DEFAULT));
          nm.createNotificationChannel(new NotificationChannel(NOTIFICATION_CHANNEL_ID_INFO, "********", NotificationManager.IMPORTANCE_DEFAULT));
      }
  
      startServiceOreoCondition();
      sp = getSharedPreferences("pfref", Activity.MODE_PRIVATE);
      editor = sp.edit();
      executeSomething();
      timer = new Timer();
      }
  
  
  
  
       private void startServiceOreoCondition() {
              if (Build.VERSION.SDK_INT &gt;= 26) {
  
                  String NOTIFICATION_CHANNEL_ID = "pl.***.***";
                  String channelName = "Communication Service";
                  NotificationChannel chan = new NotificationChannel(NOTIFICATION_CHANNEL_ID, channelName, NotificationManager.IMPORTANCE_NONE);
                  chan.setLightColor(Color.BLUE);
                  chan.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
  
                  NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
                  assert manager != null;
                  manager.createNotificationChannel(chan);
  
                  NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(context);
                  Notification notification = notificationBuilder.setOngoing(true)
                          .setContentTitle(context.getString(R.string.app_name))
                          .setPriority(NotificationManager.IMPORTANCE_MIN)
                          .setCategory(Notification.CATEGORY_SERVICE)
                          .build();
                  startForeground(4, notification);
              }else{
                  startForeground(3, new Notification());
              }
          }
  </code></pre>
  
  <p>But When I lounch this application on andorid 8.1 i see this error :</p>
  
  <pre><code>android.app.RemoteServiceException: Bad notification for startForeground: java.lang.RuntimeException: invalid channel for service notification: Notification(channel=null pri=1 contentView=null vibrate=null sound=null defaults=0x0 flags=0x42 color=0x00000000 category=service vis=PRIVATE)
  </code></pre>
  
  <p>And also I added this permission :</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.FOREGROUND_SERVICE" /&gt;
  </code></pre>