public abstract Object getSystemService (String name)
Since: API Level 1
Return the handle to a system-level service by name. The class of the returned object varies by the requested name. Currently available names are:
WINDOW_SERVICE("window")- The top-level window manager in which you can place custom windows. The returned object is a
WindowManager. LAYOUT_INFLATER_SERVICE("layout_inflater")- A
LayoutInflaterfor inflating layout resources in this context. ACTIVITY_SERVICE("activity")- A
ActivityManagerfor interacting with the global activity state of the system. POWER_SERVICE("power")- A
PowerManagerfor controlling power management. ALARM_SERVICE("alarm")- A
AlarmManagerfor receiving intents at the time of your choosing. NOTIFICATION_SERVICE("notification")- A
NotificationManagerfor informing the user of background events. KEYGUARD_SERVICE("keyguard")- A
KeyguardManagerfor controlling keyguard. LOCATION_SERVICE("location")- A
LocationManagerfor controlling location (e.g., GPS) updates. SEARCH_SERVICE("search")- A
SearchManagerfor handling search. VIBRATOR_SERVICE("vibrator")- A
Vibratorfor interacting with the vibrator hardware. CONNECTIVITY_SERVICE("connection")- A
ConnectivityManagerfor handling management of network connections. WIFI_SERVICE("wifi")- A
WifiManagerfor management of Wi-Fi connectivity. INPUT_METHOD_SERVICE("input_method")- An
InputMethodManagerfor management of input methods. UI_MODE_SERVICE("uimode")- An
UiModeManagerfor controlling UI modes. DOWNLOAD_SERVICE("download")- A
DownloadManagerfor requesting HTTP downloads
Note: System services obtained via this API may be closely associated with the Context in which they are obtained from. In general, do not share the service objects between various different contexts (Activities, Applications, Services, Providers, etc.)
Parameters
| name | The name of the desired service. |
|---|
Returns
- The service or null if the name does not exist.
See Also
WINDOW_SERVICEWindowManagerLAYOUT_INFLATER_SERVICELayoutInflaterACTIVITY_SERVICEActivityManagerPOWER_SERVICEPowerManagerALARM_SERVICEAlarmManagerNOTIFICATION_SERVICENotificationManagerKEYGUARD_SERVICEKeyguardManagerLOCATION_SERVICELocationManagerSEARCH_SERVICESearchManagerSENSOR_SERVICESensorManagerSTORAGE_SERVICEStorageManagerVIBRATOR_SERVICEVibratorCONNECTIVITY_SERVICEConnectivityManagerWIFI_SERVICEWifiManagerAUDIO_SERVICEAudioManagerTELEPHONY_SERVICETelephonyManagerINPUT_METHOD_SERVICEInputMethodManagerUI_MODE_SERVICEUiModeManagerDOWNLOAD_SERVICEDownloadManager