Notifications not showing on lock screen Code Answer

Hello Developer, Hope you guys are doing great. Today at Tutorial Guruji Official website, we are sharing the answer of Notifications not showing on lock screen without wasting too much if your time.

The question is published on by Tutorial Guruji team.

I want to show notifications on lock screen, but I’m unable to get it to work.

This is my code that I have;

                  .setContentTitle("My notification")
                  .setContentText("Much longer text that cannot fit one line...")
                  .setStyle(new NotificationCompat.BigTextStyle()
                          .bigText("Much longer text that cannot fit one line..."))


          if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
              CharSequence name = "channel1";
              String description = "test";
              int importance = NotificationManager.IMPORTANCE_HIGH;
              NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);
              // Register the channel with the system; you can't change the importance
              // or other notification behaviors after this

              NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);

The notifications is not showing on the lock screen. The settings for the app allows to show notifications on lock screen.

Any advice?



makes the notification shown on the lock screen.

We are here to answer your question about Notifications not showing on lock screen - If you find the proper solution, please don't forgot to share this with your team members.

Related Posts

Tutorial Guruji