Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/179.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何从服务创建全屏通知?_Android_Service_Notifications - Fatal编程技术网

Android 如何从服务创建全屏通知?

Android 如何从服务创建全屏通知?,android,service,notifications,Android,Service,Notifications,我有一个计时器,它正在服务上运行。我正在尝试在计时器结束但运气不佳时在锁屏上显示全屏通知。有什么办法吗?如果是,怎么可能 这是我的通知代码,但没有用 NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this, TIMER_CHANNEL_ID_LOCK) .setSmallIcon(R.drawable.i

我有一个计时器,它正在服务上运行。我正在尝试在计时器结束但运气不佳时在锁屏上显示全屏通知。有什么办法吗?如果是,怎么可能

这是我的通知代码,但没有用

NotificationCompat.Builder notificationBuilder =
                new NotificationCompat.Builder(this, TIMER_CHANNEL_ID_LOCK)
                        .setSmallIcon(R.drawable.icon_globe)
                        .setCustomContentView(customView)
                        .setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
                        .setPriority(NotificationCompat.PRIORITY_HIGH)
                        .setCategory(NotificationCompat.CATEGORY_EVENT)
                        .setFullScreenIntent(fullScreenPendingIntent, true); // NOT WORKING

我收到了一个通知。

检查。有一条注释说“当用户使用设备时,系统UI可能会选择显示提示通知,而不是启动您的全屏意图。”但设备处于密钥保护锁定状态。