private void getRunningAppProcessInfo() {
mActivityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
//获得系统里正在运行的所有进程
List runningAppProcessesList = mActiv...
分类:
移动开发 时间:
2015-04-22 11:42:27
阅读次数:
154
/*取得ConnectivityManager*/ ConnectivityManager cm=(ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE); /*判断网络状态并显示于画面中*/ i...
分类:
其他好文 时间:
2015-04-22 11:03:15
阅读次数:
140
/**
* 发送通知
*/
public void setNotification(){
/** start */
//1.得到NotificationManager:
mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFI...
分类:
移动开发 时间:
2015-04-21 13:07:52
阅读次数:
207
ConnectivityManager con=(ConnectivityManager)getSystemService(Activity.CONNECTIVITY_SERVICE);
boolean wifi=con.getNetworkInfo(ConnectivityManager.TYPE_WIFI).isConnectedOrConnecting();
boolean inte...
分类:
移动开发 时间:
2015-04-20 16:58:25
阅读次数:
362
一. 传感器
传感器使用方式和定位服务类似:应用向特定的传感器注册监听器,获得更新通知。
private void registerWithAccelerometer(){
SensorManager sm=(SensorManager) getSystemService(Context.SENSOR_SERVICE);
List sensors=sm.getSensorList(Se...
分类:
其他好文 时间:
2015-04-16 17:47:10
阅读次数:
180
配置清单文件加上权限private String getLocalIpAddress() { int paramInt = ((WifiManager) getSystemService("wifi")).getConnectionInfo().getIpAddress(); ...
分类:
移动开发 时间:
2015-04-16 09:05:16
阅读次数:
169
android的后台运行在很多service,它们在系统启动时被SystemServer开启,支持系统的正常工作,比如MountService监听是否有SD卡安装及移除,ClipboardService提供剪切板功能,PackageManagerService提供软件包的安装移除及查看等等,应用程序...
分类:
移动开发 时间:
2015-04-11 23:46:29
阅读次数:
157
LayoutInflater.inflate详解LayoutInflater概述 从XML文件中实例化一个布局成对应的View类, 它从来不会直接使用, 而是使用getLayoutInflater()或者getSystemService(String)来获得一个对应当前context的标准LayoutInflater
实例。 例如: LayoutInflater inflater =...
分类:
其他好文 时间:
2015-04-10 15:34:35
阅读次数:
115
1、方法一(如果输入法在窗口上已经显示,则隐藏,反之则显示)
[java] view
plaincopyprint?
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(0,...
分类:
移动开发 时间:
2015-04-10 15:34:15
阅读次数:
270
一、自动弹出软键盘Timertimer=newTimer();timer.schedule(newTimerTask(){publicvoidrun(){InputMethodManagerinputMethodManager=(InputMethodManager)getSystemService...
分类:
移动开发 时间:
2015-04-07 02:00:02
阅读次数:
136