Android.Locations.SettingInjectorService Class
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.Service

Remarks

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: 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