Notification.Builder.SetFullScreenIntent(PendingIntent, Boolean) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
要启动的意向,而不是将通知发布到状态栏。
[Android.Runtime.Register("setFullScreenIntent", "(Landroid/app/PendingIntent;Z)Landroid/app/Notification$Builder;", "GetSetFullScreenIntent_Landroid_app_PendingIntent_ZHandler")]
public virtual Android.App.Notification.Builder SetFullScreenIntent(Android.App.PendingIntent? intent, bool highPriority);
[<Android.Runtime.Register("setFullScreenIntent", "(Landroid/app/PendingIntent;Z)Landroid/app/Notification$Builder;", "GetSetFullScreenIntent_Landroid_app_PendingIntent_ZHandler")>]
abstract member SetFullScreenIntent : Android.App.PendingIntent * bool -> Android.App.Notification.Builder
override this.SetFullScreenIntent : Android.App.PendingIntent * bool -> Android.App.Notification.Builder
参数
- intent
- PendingIntent
PendingIntent:要启动的挂起意向
- highPriority
- Boolean
布尔值:传递 true 将导致发送此通知,即使其他通知被禁止
返回
此 Android.App.Notification.Builder 实例允许链接调用。
- 特性
注解
要启动的意向,而不是将通知发布到状态栏。 仅用于要求用户立即注意的异常高优先级通知,例如用户显式设置为特定时间的传入电话或闹钟。 如果此设施用于其他功能,请为用户提供一个选项来关闭它并使用正常通知,因为这可能会造成极大的干扰。 面向Build.VERSION_CODES的应用。Q 及更高版本必须请求权限(Manifest.permission.USE_FULL_SCREEN_INTENT),才能使用全屏意向。
在Build.VERSION_CODES之前。TIRAMISU,系统可能会显示一个抬头通知(它可能在屏幕上显示的时间比其他抬头通知长),而不是启动意向,而用户正在使用该设备。 从Build.VERSION_CODES。TIRAMISU,系统 UI 将显示一个抬头通知,而不是启动此意向,而用户正在使用该设备。 此通知将显示有强调的操作按钮。 如果发布应用保留Manifest.permission.USE_FULL_SCREEN_INTENT,则启动通知将持续显示,直到用户关闭或取消通知,或者应用取消通知。 如果发布应用不保留Manifest.permission.USE_FULL_SCREEN_INTENT,则即使屏幕锁定或关闭,通知也会显示为抬头通知,并且此通知仅持续 60 秒。
若要以全屏意向的形式启动,通知还必须发布到重要性级别设置为IMPORTANCE_HIGH或更高版本的频道。
另请参阅:
Android 参考。android.app.Notification.Builder.setFullScreenIntent
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。