语言

MockContext.GetSystemServiceName(Class) 方法

定义

引发 UnsupportedOperationException。 重写此方法以在测试中查找系统服务名称。

[Android.Runtime.Register("getSystemServiceName", "(Ljava/lang/Class;)Ljava/lang/String;", "GetGetSystemServiceName_Ljava_lang_Class_Handler", ApiSince=23)]
public override string? GetSystemServiceName(Java.Lang.Class? serviceClass);
[<Android.Runtime.Register("getSystemServiceName", "(Ljava/lang/Class;)Ljava/lang/String;", "GetGetSystemServiceName_Ljava_lang_Class_Handler", ApiSince=23)>]
override this.GetSystemServiceName : Java.Lang.Class -> string

参数

serviceClass
Class

请求的系统服务的类。 可用于测试重写;默认的模拟实现不使用此参数。

返回

不返回任何值。 默认模拟实现引发 UnsupportedOperationException;重写此方法以提供测试结果。

特性

注解

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于