[Android] 'Notification' does not work

import android.os.Build;

import android.app.NotificationChannel;
import android.app.NotificationManager;

import android.support.v4.app.NotificationCompat;
import android.support.v4.app.NotificationManagerCompat;

import static android.content.Context.NOTIFICATION_SERVICE;

String CHANNEL_ID = "processing_test.notifications";

void setup() {

void draw() {

void mousePressed() {

void initNotifications() {
    // Create the NotificationChannel, but only on API 26+ because
    // the NotificationChannel class is new and not in the support library
    String name = "Manager";
    String description = "This is problem.";
    int importance = NotificationManager.IMPORTANCE_HIGH;
    NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);
    // Register the channel with the system
    NotificationManager notificationManager = (NotificationManager)

void showNotification() {
  // Create an explicit intent for an Activity in your app
  NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(getContext())
    .setContentTitle("This is a messsage")
    .setContentText("Mouse pressed event detected!")

  // Show the notification
    NotificationManagerCompat notificationManager = NotificationManagerCompat.from(getContext());
  // notificationId is a unique int for each notification that you must define
  int notificationId = 666;
  notificationManager.notify(notificationId, mBuilder.build());

summary :

  1. There is no debug problem.
  2. Works well on Android version 6.0 smartphone.
    (The Notification screen appears.)
  3. Does not work on Android version 9 smartphones.
    (Notification screen does not appear.)

Hardware Information:

  1. Samsung Galaxy S10
  2. Android Version 9
  3. Check the application notification settings


@GWAK === have you created a Channel_ID? - If you dont the notification cannot appear on phones using 8 and 8+ but they appear on 6 (MM).

1 Like


Thank you for the answer.

void initNotifications () >> Is this not your channel ID(create)??
This is done in setup function.

Am I wrong? Please review. help me.


What’s the problem?

Please help me ~~
Please help me ~~

@Gwak === dear Gwak the problem is that i am very very busy now, that s all,and it is difficult to answer to all questions at the same time…As for the channel you are right, you have a string in your vars so this is not the reason why the notif does not appear with 8+


Thank you for your kind reply.