一.获取屏幕宽高:
(1). WindowManager wm = (WindowManager)getSystemService(Context.WINDOW_SERVICE);
int width = wm.getDefaultDisplay().getWidth();
int height = wm.getDefaultDisplay().getHeight();
(2)....
分类:
移动开发 时间:
2014-12-22 11:16:02
阅读次数:
200
InputMethodManager是一个用于控制显示或隐藏输入法面板的类(当然还有其他作用)。获取InPutMethodManager的方法很简单。InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT...
分类:
其他好文 时间:
2014-12-21 21:54:55
阅读次数:
478
LocationManager lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
List providers = lm.getProviders(true);
/* Loop over the array backwards, and if you get an accurate location, the...
分类:
移动开发 时间:
2014-12-20 19:42:35
阅读次数:
234
隐藏软键盘一直是我头痛的事情,没有找到一种真正能隐藏的方法。点击EditText的时候总是弹出软键盘。-----杯具杯具(一):Java代码InputMethodManagerim=(InputMethodManager)mEdit.getContext().getSystemService(Con...
分类:
移动开发 时间:
2014-12-12 13:09:26
阅读次数:
123
1.得到当前已连接的wifi信息WifiManager wifi_service = (WifiManager)getSystemService(WIFI_SERVICE);WifiInfo wifiInfo = wifi_service.getConnectionInfo(); 其中wifiIn....
分类:
移动开发 时间:
2014-12-10 17:49:59
阅读次数:
233
From http://stackoverflow.com/questions/15137247/how-does-getsystemservice-work-exactly https://docs.google.com/document/d/10EYlyuxDw1KPy7LJlGtgMz69.....
分类:
其他好文 时间:
2014-12-09 19:12:32
阅读次数:
358
ActivityManager mActivityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(...
分类:
移动开发 时间:
2014-12-09 15:45:29
阅读次数:
314
核心代码:Imei = ((TelephonyManager) getSystemService(TELEPHONY_SERVICE)).getDeviceId();1.加入权限在manifest.xml文件中要添加 2、代码如下:/** * *@author dingran *创建日期 20...
分类:
其他好文 时间:
2014-12-07 11:19:00
阅读次数:
269
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(getActivity().INPUT_METHOD_SERVICE);if (imm.isActive()) { imm.toggleSoftI...
分类:
其他好文 时间:
2014-12-05 14:08:57
阅读次数:
130
PowerManager pm=(PowerManager) getSystemService(Context.POWER_SERVICE);//获取电源管理器对象PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.ACQUIRE_CAUSE...
分类:
移动开发 时间:
2014-12-05 10:51:49
阅读次数:
320