码迷,mamicode.com
首页 >  
搜索关键字:getsystemservice    ( 396个结果
Android 获取屏幕宽高值
时间:2016年3月7日16:14:52note:单位为像素。三个方法中都是根据Display来进行测量。//方法一:WindowManager wm = (WindowManager) getSystemService(WINDOW_SERVICE); Display display = wm.g... ...
分类:移动开发   时间:2016-04-20 14:59:49    阅读次数:170
[android] 手机卫士设备管理权限锁屏
设备管理员 Device Admin 获取DevicePolicyManager对象,通过getSystemService(DEVICE_POLICY_MANAGER),设备策略管理器 调用DevicePolicyManager对象的lockNow()方法,锁定,此时会报 安全异常 新建一个类MyA ...
分类:移动开发   时间:2016-04-17 00:31:05    阅读次数:349
[android] 手机卫士绑定sim卡
读取sim卡的序列号,保存起来,一旦sim发生变更了,认为是小偷的sim卡,发出警告 读取sim卡序列号 获取TelephonyManager对象,通过getSystemService(TELEPHONY_SERVICE) 调用TelephonyManager对象的getSimSerialNumbe ...
分类:移动开发   时间:2016-04-12 22:36:18    阅读次数:243
10 键盘显示与隐藏
1 InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); 2 imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_A ...
分类:其他好文   时间:2016-04-12 19:35:08    阅读次数:124
4 手机震动
1 /** 2 * 手机震动, 需要权限 android.permission.VIBRATE 3 */ 4 private void vibrate() { 5 Vibrator vibrator = (Vibrator) getSystemService(VIBRATOR_SERVICE); 6 ...
分类:移动开发   时间:2016-04-11 18:30:50    阅读次数:165
[android] notification入门
通知栏,对话框,Toast是我们接触的三个提示框,通知栏是在系统的应用com.adnroid.systemui当中的 接触的几个Manger,getSystemService()方法得到的,参数: ACTIVITY_SERVICE,LAYOUT_INFLATER_SERVIC,TELEPHONY_S ...
分类:移动开发   时间:2016-04-04 11:51:18    阅读次数:417
Android入门(十五)通知
原文链接:http://www.orlion.ga/663/ 1、通知的基本用法 创建通知的步骤,首先需要一个NotificationManager来对通知进行管理,可以调用Context的getSystemService()方法获取到。getSystemService()方法接收到一个字符串参数用 ...
分类:移动开发   时间:2016-04-03 22:08:42    阅读次数:307
发送Notification
//1、获得通知管理者 NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); //2、创建Intent 对象Intent intent = new Intent(this,Othe ...
分类:其他好文   时间:2016-04-02 21:37:38    阅读次数:171
Android中的context的学习理解
Android中Context的学习理解Context是一个抽象基类,通过它getResuources.getAssets and start 其他组件(Activity,Service,broadCast,getSystemService),可以这样理解:Context提供了一个运行环境for A
分类:移动开发   时间:2016-03-06 18:52:58    阅读次数:162
android获取系统wifi状态等
WIFI 获取WIFI状态 WifiManager wifiManager = (WifiManager)context.getSystemService(Context.WIFI_SERVICE); if(wifiManager != null){ int wifiState = wifiMana
分类:移动开发   时间:2016-02-24 19:02:46    阅读次数:251
396条   上一页 1 ... 8 9 10 11 12 ... 40 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!