title: Android - Notification Channel API >= 26 is not working properly
body: <p>I've been struggling with the new <code>NotificationChannels</code> which is introduced in API 26 and up.</p>
  
  <p>I'm developing an app with an option to choose whether to be notified in four cases:</p>
  
  <ol>
  <li>Sound and Vibrate.</li>
  <li>Sound only.</li>
  <li>Vibrate only.</li>
  <li>No sound or vibrate, just a pop-up.</li>
  </ol>
  
  <p>In all cases, my app notify with sound and vibrate whatever I choose.</p>
  
  <p>My code is:</p>
  
  <pre><code>NotificationCompat.Builder builder;
      NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
      if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.O) {
          builder = new NotificationCompat.Builder(context, CHANNEL_ID);
          int importance;
          NotificationChannel channel;
  
          //Boolean for choosing Sound
          if(sound) {
              importance = NotificationManager.IMPORTANCE_DEFAULT;
          } else {
              importance = NotificationManager.IMPORTANCE_LOW;
          }
  
          channel = new NotificationChannel(CHANNEL_ID, CHANNEL_NAME, importance);
          channel.setDescription(CHANNEL_DESC);
  
          //Boolean for choosing Vibrate
          if(vibrate) {
              channel.enableVibration(true);
          } else {
              channel.enableVibration(false);
          }
  
          notificationManager.createNotificationChannel(channel);
      } else {
          builder = new NotificationCompat.Builder(context);
      }
  
      if(sound &amp;&amp; vibrate) {
          //Sound and Vibrate
          builder.setDefaults(Notification.DEFAULT_ALL);
      } else if(sound &amp;&amp; !vibrate) {
          //Sound
          builder.setDefaults(Notification.DEFAULT_SOUND);
      } else if(!sound &amp;&amp; vibrate) {
          //Vibrate
          builder.setDefaults(Notification.DEFAULT_VIBRATE);
      } else if(!sound &amp;&amp; !vibrate) {
          //None
          //Do nothing! just notification with no sound or vibration
      }
  
      builder.setSmallIcon(R.drawable.ic_logo)
              .setContentTitle(title)
              .setContentText(text)
              .setAutoCancel(true)
              .setOnlyAlertOnce(false)
              .setPriority(Notification.PRIORITY_MAX);
  </code></pre>
  
  <p>Also, I change <code>CHANNEL_ID</code> every time I run the app, so it gets a fresh Channel ID every time just for testing until I find a solution.</p>
  
  <p>Of course, it works fine with API less than 26.</p>
  
  <p>Thank you, guys!</p>