时间:2016年3月7日16:14:52note:单位为像素。三个方法中都是根据Display来进行测量。//方法一:WindowManager wm = (WindowManager) getSystemService(WINDOW_SERVICE); Display display = wm.g... ...
分类:
移动开发 时间:
2016-04-20 14:59:49
阅读次数:
170
设备管理员 Device Admin 获取DevicePolicyManager对象,通过getSystemService(DEVICE_POLICY_MANAGER),设备策略管理器 调用DevicePolicyManager对象的lockNow()方法,锁定,此时会报 安全异常 新建一个类MyA ...
分类:
移动开发 时间:
2016-04-17 00:31:05
阅读次数:
349
读取sim卡的序列号,保存起来,一旦sim发生变更了,认为是小偷的sim卡,发出警告 读取sim卡序列号 获取TelephonyManager对象,通过getSystemService(TELEPHONY_SERVICE) 调用TelephonyManager对象的getSimSerialNumbe ...
分类:
移动开发 时间:
2016-04-12 22:36:18
阅读次数:
243
1 InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); 2 imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_A ...
分类:
其他好文 时间:
2016-04-12 19:35:08
阅读次数:
124
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
通知栏,对话框,Toast是我们接触的三个提示框,通知栏是在系统的应用com.adnroid.systemui当中的 接触的几个Manger,getSystemService()方法得到的,参数: ACTIVITY_SERVICE,LAYOUT_INFLATER_SERVIC,TELEPHONY_S ...
分类:
移动开发 时间:
2016-04-04 11:51:18
阅读次数:
417
原文链接:http://www.orlion.ga/663/ 1、通知的基本用法 创建通知的步骤,首先需要一个NotificationManager来对通知进行管理,可以调用Context的getSystemService()方法获取到。getSystemService()方法接收到一个字符串参数用 ...
分类:
移动开发 时间:
2016-04-03 22:08:42
阅读次数:
307
//1、获得通知管理者 NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); //2、创建Intent 对象Intent intent = new Intent(this,Othe ...
分类:
其他好文 时间:
2016-04-02 21:37:38
阅读次数:
171
Android中Context的学习理解Context是一个抽象基类,通过它getResuources.getAssets and start 其他组件(Activity,Service,broadCast,getSystemService),可以这样理解:Context提供了一个运行环境for A
分类:
移动开发 时间:
2016-03-06 18:52:58
阅读次数:
162
WIFI 获取WIFI状态 WifiManager wifiManager = (WifiManager)context.getSystemService(Context.WIFI_SERVICE); if(wifiManager != null){ int wifiState = wifiMana
分类:
移动开发 时间:
2016-02-24 19:02:46
阅读次数:
251