I wrote a standard code for displaying notifications in MainActivity, but it is not displayed and does not generate an error. Code in OnCreate:
Intent notificationIntent = new Intent(this, MainActivity.class); PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT); Resources res = this.getResources(); NotificationCompat.Builder builder = new NotificationCompat.Builder(this); Notification notification = builder.setContentIntent(contentIntent) .setSmallIcon(R.drawable.walk) .setContentTitle(res.getString(R.string.route_notif_title)) .setContentText(res.getString(R.string.route_notif_text)) .setWhen(System.currentTimeMillis()) .setAutoCancel(true) .build(); NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); notificationManager.notify(112, notification);