ServiceInfo.ForegroundServiceTypeNone 字段

定义

如果未在清单文件中设置默认前台服务类型。

[Android.Runtime.Register("FOREGROUND_SERVICE_TYPE_NONE", ApiSince=29)]
public const Android.Content.PM.ForegroundService ForegroundServiceTypeNone = 0;
[<Android.Runtime.Register("FOREGROUND_SERVICE_TYPE_NONE", ApiSince=29)>]
val mutable ForegroundServiceTypeNone : Android.Content.PM.ForegroundService

字段值

Value = 0

实现

属性

注解

如果未在清单文件中设置默认前台服务类型。

面向 API 级别的应用及更高版本 android.os.Build.VERSION_CODES#UPSIDE_DOWN_CAKE 不应使用此类型,通过此类型调用 android.app.Service#startForeground(int, android.app.Notification, int) 将得到一个 android.app.InvalidForegroundServiceTypeException

此成员已弃用。 请勿使用。

适用于 . 的 android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_NONEJava 文档

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于