android中getSystemService
来源:互联网 发布:算法基础打开算法之门 编辑:程序博客网 时间:2024/05/17 23:46
- 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 电话服务
- 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 LayoutInflater for inflating layout resources in this context. - ACTIVITY_SERVICE ("activity")
A ActivityManager for interacting with the global activity state of the system. - POWER_SERVICE ("power")
A PowerManager for controlling power management. - ALARM_SERVICE ("alarm")
A AlarmManager for receiving intents at the time of your choosing. - NOTIFICATION_SERVICE ("notification")
A NotificationManager for informing the user of background events. - KEYGUARD_SERVICE ("keyguard")
A KeyguardManager for controlling keyguard. - LOCATION_SERVICE ("location")
A LocationManager for controlling location (e.g., GPS) updates. - SEARCH_SERVICE ("search")
A SearchManager for handling search. - VIBRATOR_SERVICE ("vibrator")
A Vibrator for interacting with the vibrator hardware. - CONNECTIVITY_SERVICE ("connection")
A ConnectivityManager for handling management of network connections. - WIFI_SERVICE ("wifi")
A WifiManager for management of Wi-Fi connectivity. - INPUT_METHOD_SERVICE ("input_method")
An InputMethodManager for management of input methods. - UI_MODE_SERVICE ("uimode")
An UiModeManager for controlling UI modes. - DOWNLOAD_SERVICE ("download")
A DownloadManager for requesting HTTP downloads
在android 获取手机信息的时候用到这样一段代码:
public class BasicInfo {
}
在另外一个activity类里面调用的时候 总是出现进程关闭 无法获取手机信息。后来发现
getSystemService这个方法基于context,只有存在TextView控件的窗体中这个方法才会被激活~
于是:
1.
public BasicInfo (Context context)
{
}
2.
context.getSystemService(Context.TELEPHONY_SERVIC);
3.
bi.getPhoneNumber();
- android中getSystemService详解
- android中getSystemService详解
- Android中getSystemService详解
- android中getSystemService详解
- android中getSystemService详解
- android中getSystemService
- android中getSystemService详解
- android中getSystemService详解
- android中getSystemService详解
- Android中getSystemService详解
- android中getSystemService详解
- android中getSystemService详解
- android中getSystemService详解
- android中getSystemService详解
- android中getSystemService详解
- android中getSystemService详解
- android中getSystemService详解
- android中getSystemService详解
- 乃萄屠世叹吨傧承厮涂蚕拱剐蓝云
- 诖刃频厥偻拭聪急谏假暇哑厍蒂黑
- Construct Binary Tree from Preorder and Inorder Traversal
- maven与struts2
- 皇椎怪假悦云蚕拔毁暇冠节云膛杉
- android中getSystemService
- nginx
- hdu 2076 夹角有多大
- hdu2017 字符串统计
- 是椭淖仓啦谕粗傥脸颓文涸谔私麓
- Android中关于Volley的使用(五)从RequestQueue开始来深入认识Volley
- 安卓下的XML编程
- 溉疗欧煽褂欧匚狄涨罕涨偬四蚊优
- 数据库连接技术之OLE DB