ServiceInfo.ForegroundServiceTypeMediaPlayback 字段

定义

注意

This constant will be removed in the future version. Use Android.Content.PM.ForegroundService enum directly instead of this field.

与特性中android.R.attr#foregroundServiceType对应的mediaPlayback常量。

[Android.Runtime.Register("FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK", ApiSince=29)]
[Android.Runtime.RequiresPermission("android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK")]
[System.Obsolete("This constant will be removed in the future version. Use Android.Content.PM.ForegroundService enum directly instead of this field.", true)]
public const Android.Content.PM.ForegroundService ForegroundServiceTypeMediaPlayback = 2;
[<Android.Runtime.Register("FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK", ApiSince=29)>]
[<Android.Runtime.RequiresPermission("android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK")>]
[<System.Obsolete("This constant will be removed in the future version. Use Android.Content.PM.ForegroundService enum directly instead of this field.", true)>]
val mutable ForegroundServiceTypeMediaPlayback : Android.Content.PM.ForegroundService

字段值

Value = 2

实现

属性

注解

与特性中android.R.attr#foregroundServiceType对应的mediaPlayback常量。 音乐、视频、新闻或其他媒体播放。

从面向 API 级别的 android.os.Build.VERSION_CODES#UPSIDE_DOWN_CAKE 应用启动具有此类型的前台服务需要权限 android.Manifest.permission#FOREGROUND_SERVICE_MEDIA_PLAYBACK

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

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

适用于