List of usage examples for android.app NotificationManager createNotificationChannel
public void createNotificationChannel(@NonNull NotificationChannel channel)
From source file:org.pocketworkstation.pckeyboard.LatinIME.java
private void createNotificationChannel() { // Create the NotificationChannel, but only on API 26+ because // the NotificationChannel class is new and not in the support library if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { CharSequence name = getString(R.string.notification_channel_name); String description = getString(R.string.notification_channel_description); int importance = NotificationManager.IMPORTANCE_LOW; NotificationChannel channel = new NotificationChannel(NOTIFICATION_CHANNEL_ID, name, importance); channel.setDescription(description); // Register the channel with the system; you can't change the importance // or other notification behaviors after this NotificationManager notificationManager = getSystemService(NotificationManager.class); notificationManager.createNotificationChannel(channel); }//from ww w . j av a 2 s .co m }