title: How to turn notification off programatically
body: <p><strong>I have a 4 radio button notification type 0,1,2,3
  if the user select notificication type 0 , the user shoul not get notification.
  how to do it programatically.</strong></p>
  <pre><code>(notificationType != 0) {
              if (notificationType == 1) {
                  soundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
              }
              if (notificationType == 2) {
  
                  soundUri = Uri.parse(&quot;android.resource://&quot; + context.getPackageName() + &quot;/&quot; + R.raw.azan);
              }
              if (notificationType == 3) {
                  soundUri = Uri.parse(&quot;android.resource://&quot; + context.getPackageName() + &quot;/&quot; + R.raw.mohsin_mava);
              }
          }
  </code></pre>
  <p><strong>NotificaitionReciever.java</strong></p>
  <pre><code>if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.O) {
  
                      NotificationChannel mChannelFajr = notificationManager.getNotificationChannel(FAJR_CHANNEL_ID);
                      if (mChannelFajr == null) {
                          mChannelFajr = new NotificationChannel(FAJR_CHANNEL_ID, fajrChannelName, importance);
                          mChannelFajr.setDescription(notificationText);
                          mChannelFajr.enableVibration(true);
                          mChannelFajr.enableLights(true);
                          mChannelFajr.setLockscreenVisibility(VISIBILITY_PUBLIC);
                          mChannelFajr.setSound(soundUri, audioAttributes);
                          notificationManager.createNotificationChannel(mChannelFajr);
                      }
  
                      builder = new NotificationCompat.Builder(context, FAJR_CHANNEL_ID);
  
                      builder.setContentTitle(&quot;FAJR NAMAZ&quot;)  // required
                              .setSmallIcon(R.mipmap.ic_darshika_logo) // required
                              .setLargeIcon(BitmapFactory.decodeResource(context.getResources(),
                                      R.mipmap.ic_darshika_logo))
                              .setContentText(notificationText) // required
                              .setDefaults(Notification.DEFAULT_ALL)
                              .setAutoCancel(true)
                              .setLights(Color.MAGENTA, 500, 500)
                              .setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
                              .setSound(soundUri)
                              .setContentIntent(pendingIntent)
                              .setTicker(context.getString(R.string.app_name));
  
                  } else {
  
                      builder = new NotificationCompat.Builder(context, FAJR_CHANNEL_ID);
  
                      builder.setContentTitle(&quot;FAJR NAMAZ&quot;)
                              .setSmallIcon(R.mipmap.ic_darshika_logo) // required
                              .setLargeIcon(BitmapFactory.decodeResource(context.getResources(),
                                      R.mipmap.ic_darshika_logo))
                              .setContentText(notificationText)  // required
                              .setDefaults(Notification.DEFAULT_ALL)
                              .setAutoCancel(true)
                              .setSound(soundUri)
                              .setLights(Color.MAGENTA, 500, 500)
                              .setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
                              .setContentIntent(pendingIntent)
                              .setTicker(context.getString(R.string.app_name))
                              .setPriority(Notification.PRIORITY_HIGH);
                  }
                  notification = builder.build();
                  notificationManager.notify(0, notification);
  </code></pre>
  <p><strong>Here i have made a channel for notification</strong>
  How to turn it off programatically?</p>