Compartilhar via


SettingInjectorService.OnGetEnabled Method

Definition

Returns the android.preference.Preference#isEnabled() value.

[Android.Runtime.Register("onGetEnabled", "()Z", "GetOnGetEnabledHandler")]
protected abstract bool OnGetEnabled ();
[<Android.Runtime.Register("onGetEnabled", "()Z", "GetOnGetEnabledHandler")>]
abstract member OnGetEnabled : unit -> bool

Returns

the android.preference.Preference#isEnabled() value

Attributes

Remarks

Returns the android.preference.Preference#isEnabled() value. Should not perform unpredictably-long operations such as network access--see the running-time comments in the class-level javadoc. <p/> Note that to prevent churn in the settings list, there is no support for dynamically choosing to hide a setting. Instead you should have this method return false, which will disable the setting and its link to your setting activity. One reason why you might choose to do this is if android.provider.Settings.Secure#LOCATION_MODE is android.provider.Settings.Secure#LOCATION_MODE_OFF. <p/> It is possible that the user may click on the setting before this method returns, so your settings activity must handle the case where it is invoked even though the setting is disabled. The simplest approach may be to simply call android.app.Activity#finish() when disabled.

Java documentation for android.location.SettingInjectorService.onGetEnabled().

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