語言

DevicePolicyManager.SetTimeZone(ComponentName, String) 方法

定義

由裝置擁有者或組織擁有的管理設定檔的設定檔擁有者呼叫,以設定系統的永久預設時區。

[Android.Runtime.Register("setTimeZone", "(Landroid/content/ComponentName;Ljava/lang/String;)Z", "GetSetTimeZone_Landroid_content_ComponentName_Ljava_lang_String_Handler", ApiSince=28)]
[Android.Runtime.RequiresPermission("android.permission.SET_TIME_ZONE")]
public virtual bool SetTimeZone(Android.Content.ComponentName? admin, string? timeZone);
[<Android.Runtime.Register("setTimeZone", "(Landroid/content/ComponentName;Ljava/lang/String;)Z", "GetSetTimeZone_Landroid_content_ComponentName_Ljava_lang_String_Handler", ApiSince=28)>]
[<Android.Runtime.RequiresPermission("android.permission.SET_TIME_ZONE")>]
abstract member SetTimeZone : Android.Content.ComponentName * string -> bool
override this.SetTimeZone : Android.Content.ComponentName * string -> bool

參數

admin
ComponentName

這個請求就是和這個 DeviceAdminReceiver 問題有關的。 如果呼叫者不是裝置管理員,則為 Null。

timeZone
String

列表中的 Olson ID 之一由 java.util.TimeZone#getAvailableIDs

傳回

true 如果設定時區成功, false 否則。

屬性

備註

由裝置擁有者或組織擁有的管理設定檔的設定檔擁有者呼叫,以設定系統的永久預設時區。 只有當 android.provider.Settings.Global#AUTO_TIME_ZONE 為 0 時才會生效,否則 false 會回傳。

Java 文件 android.app.admin.DevicePolicyManager.setTimeZone(android.content.ComponentName, java.lang.String)

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於