다음을 통해 공유


DevicePolicyResourcesManager.GetString Method

Definition

Overloads

GetString(String, ISupplier)

Returns the appropriate updated string for the stringId (see DevicePolicyResources.Strings) if one was set using setStrings, otherwise returns the string from defaultStringLoader.

GetString(String, ISupplier, Object[])

GetString(String, ISupplier)

Returns the appropriate updated string for the stringId (see DevicePolicyResources.Strings) if one was set using setStrings, otherwise returns the string from defaultStringLoader.

[Android.Runtime.Register("getString", "(Ljava/lang/String;Ljava/util/function/Supplier;)Ljava/lang/String;", "GetGetString_Ljava_lang_String_Ljava_util_function_Supplier_Handler", ApiSince=33)]
public virtual string? GetString (string stringId, Java.Util.Functions.ISupplier defaultStringLoader);
[<Android.Runtime.Register("getString", "(Ljava/lang/String;Ljava/util/function/Supplier;)Ljava/lang/String;", "GetGetString_Ljava_lang_String_Ljava_util_function_Supplier_Handler", ApiSince=33)>]
abstract member GetString : string * Java.Util.Functions.ISupplier -> string
override this.GetString : string * Java.Util.Functions.ISupplier -> string

Parameters

stringId
String

The IDs to get the updated resource for.

defaultStringLoader
ISupplier

To get the default string if no updated string was set for stringId.

Returns

Attributes

Remarks

Returns the appropriate updated string for the stringId (see DevicePolicyResources.Strings) if one was set using setStrings, otherwise returns the string from defaultStringLoader.

Also returns the string from defaultStringLoader if stringId is DevicePolicyResources#UNDEFINED.

Calls to this API will not return null unless no updated drawable was found and the call to defaultStringLoader returned null.

Callers should register for DevicePolicyManager#ACTION_DEVICE_POLICY_RESOURCE_UPDATED to get notified when a resource has been updated.

Note that each call to this API loads the resource from the package that called setStrings to set the updated resource.

Java documentation for android.app.admin.DevicePolicyResourcesManager.getString(java.lang.String, java.util.function.Supplier<java.lang.String>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

GetString(String, ISupplier, Object[])

[Android.Runtime.Register("getString", "(Ljava/lang/String;Ljava/util/function/Supplier;[Ljava/lang/Object;)Ljava/lang/String;", "GetGetString_Ljava_lang_String_Ljava_util_function_Supplier_arrayLjava_lang_Object_Handler", ApiSince=33)]
public virtual string? GetString (string stringId, Java.Util.Functions.ISupplier defaultStringLoader, params Java.Lang.Object[] formatArgs);
[<Android.Runtime.Register("getString", "(Ljava/lang/String;Ljava/util/function/Supplier;[Ljava/lang/Object;)Ljava/lang/String;", "GetGetString_Ljava_lang_String_Ljava_util_function_Supplier_arrayLjava_lang_Object_Handler", ApiSince=33)>]
abstract member GetString : string * Java.Util.Functions.ISupplier * Java.Lang.Object[] -> string
override this.GetString : string * Java.Util.Functions.ISupplier * Java.Lang.Object[] -> string

Parameters

stringId
String
defaultStringLoader
ISupplier
formatArgs
Object[]

Returns

Attributes

Applies to