Dynamically specifies the enabled status of a preference injected into
the list of app settings displayed by the system settings app
See Also:
SettingInjectorService Members
Syntax
[Android.Runtime.Register("android/location/SettingInjectorService", DoNotGenerateAcw=true)]
public abstract class
SettingInjectorService :
Android.App.ServiceRemarks
Dynamically specifies the enabled status of a preference injected into
the list of app settings displayed by the system settings app
For use only by apps that are included in the system image, for preferences that affect multiple
apps. Location settings that apply only to one app should be shown within that app,
rather than in the system settings.
To add a preference to the list, a subclass of Android.Locations.SettingInjectorService must be declared in
the manifest as so:
xml Example
<service android:name="com.example.android.injector.MyInjectorService" >
<intent-filter>
<action android:name="android.location.SettingInjectorService" />
</intent-filter>
<meta-data
android:name="android.location.SettingInjectorService"
android:resource="@xml/my_injected_location_setting" />
</service>
The resource file specifies the static data for the setting:
xml Example
<injected-location-setting xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/injected_setting_title"
android:icon="@drawable/ic_acme_corp"
android:settingsActivity="com.example.android.injector.MySettingActivity"
/>
Here:
- title: The Android.Preferences.Preference.TitleFormatted value. The title should make
it clear which apps are affected by the setting, typically by including the name of the
developer. For example, "Acme Corp. ads preferences."
- icon: The Android.Preferences.Preference.Icon value. Typically this will be a
generic icon for the developer rather than the icon for an individual app.
- settingsActivity: the activity which is launched to allow the user to modify the setting
value. The activity must be in the same package as the subclass of
Android.Locations.SettingInjectorService. The activity should use your own branding to help emphasize
to the user that it is not part of the system settings.
To ensure a good user experience, your
Android.App.Application.OnCreate,
and
SettingInjectorService.OnGetEnabled methods must all be fast. If either is slow,
it can delay the display of settings values for other apps as well. Note further that these
methods are called on your app's UI thread.
For compactness, only one copy of a given setting should be injected. If each account has a
distinct value for the setting, then only settingsActivity should display the value for
each account.
[Android Documentation]
Requirements
Namespace: Android.Locations
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0