語言

DevicePolicyManager.SetLocationEnabled(ComponentName, Boolean) 方法

定義

裝置擁有者呼叫來設定使用者的全域位置設定。

[Android.Runtime.Register("setLocationEnabled", "(Landroid/content/ComponentName;Z)V", "GetSetLocationEnabled_Landroid_content_ComponentName_ZHandler", ApiSince=30)]
public virtual void SetLocationEnabled(Android.Content.ComponentName admin, bool locationEnabled);
[<Android.Runtime.Register("setLocationEnabled", "(Landroid/content/ComponentName;Z)V", "GetSetLocationEnabled_Landroid_content_ComponentName_ZHandler", ApiSince=30)>]
abstract member SetLocationEnabled : Android.Content.ComponentName * bool -> unit
override this.SetLocationEnabled : Android.Content.ComponentName * bool -> unit

參數

admin
ComponentName

這個請求就是與此 DeviceAdminReceiver 相關聯的

locationEnabled
Boolean

是否應該啟用或關閉定位。 <b>注意: </b> 開啟 android.content.pm.PackageManager#FEATURE_AUTOMOTIVE automotive builds,停用呼叫將被忽略。

屬性

備註

裝置擁有者呼叫來設定使用者的全域位置設定。

Java 文件 android.app.admin.DevicePolicyManager.setLocationEnabled(android.content.ComponentName, boolean)

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

適用於