title: The notification does not appear on the screen, only the icon in the status bar Oreo
body: <p>Hello I wrote a class to create notifications, but the problem that there is the notification icon that appears in the status bar, the notification block does not appear or even in the lock screen. In the doc it is written to use <code>NotificationManagerCompat</code> to show notification (  <a href="https://developer.android.com/training/notify-user/build-notification#notify" rel="nofollow noreferrer">Docs link</a>). Here is my code:</p>
  
  <pre><code>public class NotificationsService {
      private Context mContext;
      private NotificationManager mNotificationManager;
  
      public NotificationsService(Context context) {
          mContext = context;
      }
  
      public void sendNotification(int iconResource) {
          Notification notification = buildNotification(iconResource);
  //        mNotificationManager.notify(0 /* ID of notification */, notification);
  
          NotificationManagerCompat notificationManager = NotificationManagerCompat.from(mContext);
          notificationManager.notify(70, notification);
      }
  
      public Notification buildNotification(int iconResource) {
          String CHANNEL_ID = "type"; // The id of the channel.
          CharSequence channelName = "dsfsf";
  
          NotificationChannel channel = null;
  
          if (android.os.Build.VERSION.SDK_INT &gt;= android.os.Build.VERSION_CODES.O) {
              channel = new NotificationChannel(CHANNEL_ID, channelName, NotificationManager.IMPORTANCE_DEFAULT);
          }
  
          Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
          NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(mContext, CHANNEL_ID)
                  .setSmallIcon(iconResource)
                  .setContentTitle("title")
                  .setContentText("message")
                  .setAutoCancel(true)
                  .setPriority(NotificationCompat.PRIORITY_DEFAULT)
                  .setSound(defaultSoundUri)
                  .setChannelId(CHANNEL_ID);
  //                .setContentIntent(pendingIntent);
  
          mNotificationManager = (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE);
  
          if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.O &amp;&amp; mNotificationManager != null) {
              mNotificationManager.createNotificationChannel(channel);
          }
  
          return notificationBuilder.build();
      }
  </code></pre>
  
  <p>And using like this:</p>
  
  <pre><code>NotificationsService notif = new NotificationsService(context);
    notif.sendNotification(R.mipmap.ic_launcher);
  </code></pre>
  
  <p>Only the app icon appears and the notification only in the status bar</p>
  
  <p><a href="https://i.stack.imgur.com/LTYNy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LTYNy.png" alt="enter image description here"></a></p>