我的NotificationManager通知未在API 28上显示,但在API 25上显示

时间:2019-08-06 17:00:08

标签: android

我有NotificationManager,它显示来自线程的通知,但是这些通知仅在API 28下显示。 模拟器API:25-工作 智能手机API:28-不起作用 模拟器API 28-不起作用


NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context).setSmallIcon(R.drawable.notification).setContentTitle(context.getString(R.string.Running));


        NotificationManager notificationManager = (NotificationManager) context.getSystemService(context.NOTIFICATION_SERVICE);

        mBuilder.setOngoing(true);
        mBuilder.setPriority(-1);
        notificationManager.notify(001, mBuilder.build());

我所有的通知都不会显示在我的较新API上

0 个答案:

没有答案