/**
* 获取应用层窗口管理器
* @param mContext
* @return
*/
public static WindowManager getWindowManager(Context mContext) {
WindowManager manager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
return manager;
}
/**
* 获取应用层布局填充器
* @param mContext
* @return
*/
public static LayoutInflater getLayoutInflater(Context mContext) {
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
return inflater;
}
/**
* 获取应用层账户管理器
* @param mContext
* @return
*/
public static AccountManager getAccountManager(Context mContext) {
AccountManager manager = (AccountManager) mContext.getSystemService(Context.ACCOUNT_SERVICE);
return manager;
}
/**
* 获取应用层活动管理器
* @param mContext
* @return
*/
public static ActivityManager getActivityManager(Context mContext) {
ActivityManager manager = (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE);
return manager;
}
/**
* 获取应用层电源管理器
* @param mContext
* @return
*/
public static PowerManager getPowerManager(Context mContext) {
PowerManager manager = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
return manager;
}
/**
* 获取应用层警报管理器
* @param mContext
* @return
*/
public static AlarmManager getAlarmManager(Context mContext) {
AlarmManager manager = (AlarmManager) mContext.getSystemService(Context.ALARM_SERVICE);
return manager;
}
/**
* 获取应用层 辅助性管理器
* @param mContext
* @return
*/
public static AccessibilityManager getAccessibilityManager(Context mContext) {
AccessibilityManager manager = (AccessibilityManager) mContext.getSystemService(Context.ACCESSIBILITY_SERVICE);
return manager;
}
/**
* 获取应用层字幕管理器
* @param mContext
* @return
*/
public static CaptioningManager getCaptioningManager(Context mContext) {
CaptioningManager manager = (CaptioningManager) mContext.getSystemService(Context.CAPTIONING_SERVICE);
return manager;
}
/**
* 获取应用层通知管理器
* @param mContext
* @return
*/
public static NotificationManager getNotificationManager(Context mContext) {
NotificationManager manager = (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE);
return manager;
}
/**
* 获取应用层键盘管理器
* @param mContext
* @return
*/
public static KeyguardManager getKeyguardManager(Context mContext) {
KeyguardManager manager = (KeyguardManager) mContext.getSystemService(Context.KEYGUARD_SERVICE);
return manager;
}
/**
* 获取应用层定位管理器
* @param mContext
* @return
*/
public static LocationManager getLocationManager(Context mContext) {
LocationManager manager = (LocationManager) mContext.getSystemService(Context.LOCATION_SERVICE);
return manager;
}
/**
* 获取应用层搜索管理器
* @param mContext
* @return
*/
public static SearchManager getSearchManager(Context mContext) {
SearchManager manager = (SearchManager) mContext.getSystemService(Context.SEARCH_SERVICE);
return manager;
}
/**
* 获取应用层传感器管理器
* @param mContext
* @return
*/
public static SensorManager getSensorManager(Context mContext) {
SensorManager manager = (SensorManager) mContext.getSystemService(Context.SENSOR_SERVICE);
return manager;
}
/**
* 获取应用层存储管理器
* @param mContext
* @return
*/
public static StorageManager getStorageManager(Context mContext) {
StorageManager manager = (StorageManager) mContext.getSystemService(Context.STORAGE_SERVICE);
return manager;
}
/**
* 获取应用层壁纸管理器
* @param mContext
* @return
*/
public static WallpaperManager getWallpaperManager(Context mContext) {
WallpaperManager manager = (WallpaperManager) mContext.getSystemService(Context.WALLPAPER_SERVICE);
return manager;
}
/**
* 获取应用层振动器
* @param mContext
* @return
*/
public static Vibrator getVibrator(Context mContext) {
Vibrator vibrator = (Vibrator) mContext.getSystemService(Context.VIBRATOR_SERVICE);
return vibrator;
}
/**
* 获取应用层连通性管理器
* @param mContext
* @return
*/
public static ConnectivityManager getConnectivityManager(Context mContext) {
ConnectivityManager manager = (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
return manager;
}
/**
* 获取应用层无线网络管理器
* @param mContext
* @return
*/
public static WifiManager getWifiManager(Context mContext) {
WifiManager manager = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE);
return manager;
}
/**
* 获取应用层音频管理器
* @param mContext
* @return
*/
public static AudioManager getAudioManager(Context mContext) {
AudioManager manager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
return manager;
}
/**
* 获取应用层媒体路由器
* @param mContext
* @return
*/
public static MediaRouter getMediaRouter(Context mContext) {
MediaRouter router = (MediaRouter) mContext.getSystemService(Context.MEDIA_ROUTER_SERVICE);
return router;
}
/**
* 获取应用层媒体会话管理器
* @param mContext
* @return
*/
public static MediaSessionManager getMediaSessionManager(Context mContext) {
MediaSessionManager manager = (MediaSessionManager) mContext.getSystemService(Context.MEDIA_SESSION_SERVICE);
return manager;
}
/**
* 获取应用层电话管理器
* @param mContext
* @return
*/
public static TelephonyManager getTelephonyManager(Context mContext) {
TelephonyManager manager = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE);
return manager;
}
/**
* 获取应用层电信管理器
* @param mContext
* @return
*/
public static TelecomManager getTelecomManager(Context mContext) {
TelecomManager manager = (TelecomManager) mContext.getSystemService(Context.TELECOM_SERVICE);
return manager;
}
/**
* 获取应用层剪切板管理器
* @param mContext
* @return
*/
public static ClipboardManager getClipboardManager(Context mContext) {
ClipboardManager manager = (ClipboardManager) mContext.getSystemService(Context.CLIPBOARD_SERVICE);
return manager;
}
/**
* 获取应用层输入法管理器
* @param mContext
* @return
*/
public static InputMethodManager getInputMethodManager(Context mContext) {
InputMethodManager manager = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
return manager;
}
/**
* 获取应用层文本服务管理器
* @param mContext
* @return
*/
public static TextServicesManager getTextServicesManager(Context mContext) {
TextServicesManager manager = (TextServicesManager) mContext.getSystemService(Context.TEXT_SERVICES_MANAGER_SERVICE);
return manager;
}
/**
* 获取应用层Ui模式管理器
* @param mContext
* @return
*/
public static UiModeManager getUiModeManager(Context mContext) {
UiModeManager manager = (UiModeManager) mContext.getSystemService(Context.UI_MODE_SERVICE);
return manager;
}
/**
* 获取应用层下载管理器
* @param mContext
* @return
*/
public static DownloadManager getDownloadManager(Context mContext) {
DownloadManager manager = (DownloadManager) mContext.getSystemService(Context.DOWNLOAD_SERVICE);
return manager;
}
/**
* 获取应用层电池管理器
* @param mContext
* @return
*/
public static BatteryManager getBatteryManager(Context mContext) {
BatteryManager manager = (BatteryManager) mContext.getSystemService(Context.BATTERY_SERVICE);
return manager;
}
应用层管理器详细介绍
最新推荐文章于 2021-06-08 11:36:31 发布