唤醒屏幕:1 PowerManager pm = (PowerManager) context2 .getSystemService(Context.POWER_SERVICE);3 WakeLock mWakeLock = pm.ne...
分类:
其他好文 时间:
2015-12-21 15:53:13
阅读次数:
163
示例: 1 NotificationManager nm = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE); 2 Notification n = new Notification...
分类:
其他好文 时间:
2015-12-14 10:37:49
阅读次数:
222
private boolean getNetWorkStatus() { boolean netSataus = false; ConnectivityManager cwjManager = (ConnectivityManager) getSystemService...
分类:
其他好文 时间:
2015-12-08 16:00:36
阅读次数:
137
把一个控件长期的添加到窗口上private void showAddress(String address){ wm = (WindowManager) this.getSystemService(Context.WINDOW_SERVICE); Wind...
分类:
移动开发 时间:
2015-12-03 17:10:04
阅读次数:
166
LayoutInflater作用是将layout的xml布局文件实例化为View类对象。获取LayoutInflater的方法有如下三种:LayoutInflater inflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_I...
分类:
其他好文 时间:
2015-11-29 10:43:22
阅读次数:
163
首先是系统剪切板的调用服务:ClipboardManager ClipboardManager=getSystemService(Context.CLIPBOARD_SERVICE);然后是写入,取出。这里需要注意的是,在android版本11之前,利用剪切板传递数据是使用setText和getTe...
分类:
移动开发 时间:
2015-11-24 12:48:43
阅读次数:
463
Downloadmanager使用
DownloadManager是android提供的一个下载管理器
缺点:不支持断点续传
使用方法:
创建实例:DownloadManager manager = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);
创建下载任务:DownloadManager.R...
分类:
移动开发 时间:
2015-11-19 16:44:39
阅读次数:
157
ConnectivityManager manager = (ConnectivityManager) this .getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo in...
分类:
其他好文 时间:
2015-11-19 16:14:43
阅读次数:
132
android获得屏幕高度和宽度android获取屏幕的高度和宽度用到WindowManager这个类,两种方法: 1、WindowManager wm = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE);i...
分类:
移动开发 时间:
2015-11-11 10:04:45
阅读次数:
240
内容简介【Android】如何调节屏幕亮度,关闭屏幕【Android】如何调节屏幕亮度,关闭屏幕工作中遇到的,记录一下。方法1:PowerManagermanager=(PowerManager)getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLockwl=manager.newWakeLock(PowerManager.PARTIAL_WAKE..
分类:
移动开发 时间:
2015-11-07 06:46:06
阅读次数:
310