系统服务-----Activity服务的获取getSystemService
来源:互联网 发布:excel恢复前一天数据 编辑:程序博客网 时间:2024/04/30 18:40
android的后台存在很多service,它们在系统启动的时候被SystemServer开启,来为系统的正常运行做支撑。Activity中要调用这些service就得使用getSystemService方法,这也是Activity很重要的一个API。根据传入的Name取得对应的Object,然后转换成相应的服务对象。
传入的Name
返回的对象
说明
WINDOW_SERVICE
WindowManager
管理打开的窗口程序
LAYOUT_INFLATER_SERVICE
LayoutInflater
取得xml里定义的view
ACTIVITY_SERVICE
ActivityManager
管理应用程序的系统状态
POWER_SERVICE
PowerManger
电源的服务
ALARM_SERVICE
AlarmManager
闹钟的服务
NOTIFICATION_SERVICE
NotificationManager
状态栏的服务
KEYGUARD_SERVICE
KeyguardManager
键盘锁的服务
LOCATION_SERVICE
LocationManager
位置的服务,如GPS
SEARCH_SERVICE
SearchManager
搜索的服务
VEBRATOR_SERVICE
Vebrator
手机震动的服务
CONNECTIVITY_SERVICE
Connectivity
网络连接的服务
WIFI_SERVICE
WifiManager
Wi-Fi服务
TELEPHONY_SERVICE
TeleponyManager
电话服务
图片欣赏:
- 系统服务-----Activity服务的获取getSystemService
- Android getSystemService获取系统相应的服务
- 浅析getSystemService获取系统服务
- Android 关于系统Context.getSystemService(String arg0)获取系统服务的详细剖析-getSystemService
- 从getSystemService()出发获取系统服务
- 系统服务getSystemService
- LayoutInflater的使用 和getSystemService系统服务
- LayoutInflater的使用 和getSystemService系统服务
- LayoutInflater的使用 和getSystemService系统服务
- Android-获取服务getContext().getSystemService()
- Android获取系统服务getSystemService与getService区别
- getSystemService获得系统服务列表
- getSystemService的一些常用服务
- Android之getSystemService 各种系统服务总结
- Androidの系统服务之getSystemService
- android中的系统级服务getSystemService(name)
- android getSystemService(系统服务)学习
- android中getSystemService通过系统提供的Manager接口来访问及设置服务数据
- Linux 主机的硬件配备
- 【C#学习杂记】Directory获取文件路径
- 鹅厂揭秘——高端大气的App电量测试
- MFC类层次结构图
- 查看linux机器是32位还是64位的方法
- 系统服务-----Activity服务的获取getSystemService
- UBUNTU JDK配置
- C++ 读书笔记
- mysqli
- LeetCode Count Complete Tree Nodes
- php 实现qq一键登录
- xib 0710
- MariaDB学习笔记(2)----检索数据
- 【技术支持】Oracle报连接超时,TNS-12535:TNS:operation timed out。WARNING: inbound connection timed out (ORA-3136)