码迷,mamicode.com
首页 >  
搜索关键字:getsystemservice    ( 396个结果
android:强制关闭其他应用
强制关闭其他应用,可以使用ActivityManager,首先需要获取(ActivityManager)getSystemService(Context.ACTIVITY_SERVICE);然后可以调用其函数来进行关闭操作,目前来看有两种方法:1. void killBackgroundProces...
分类:移动开发   时间:2014-08-01 18:45:32    阅读次数:292
android 解锁 点亮屏幕
//保持屏幕常亮  PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);  mWakeLock = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, LOCK_TAG);  mWakeLo...
分类:移动开发   时间:2014-07-29 18:04:13    阅读次数:236
android之Alarm
Alarm和Timer不同的是Alarm是在应用程序之外操作的。即使应用程序关闭,它们也仍然能够用来激活应用程序事件或操作。 public void createAlarm(){ //获取一个Alarm Manager的引用 AlarmManager alarmManager = (AlarmManager)getSystemService(Context.ALARM_SERVICE);...
分类:移动开发   时间:2014-07-29 15:09:38    阅读次数:254
Notification
在发送一个Notification前,我们需要准备好一个NotificationManagerNotificationManager manager = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE)...
分类:其他好文   时间:2014-07-28 21:25:24    阅读次数:165
android 获取手机型号,本机电话号码,SDK版本以及firmwarw版本号(即系统版本号)
Android开发平台中,可通过TelephonyManager 获取本机号码。1 TelephonyManager phoneMgr=(TelephonyManager)this.getSystemService(Context.TELEPHONY_SERVICE);2 txtPhoneNumbe...
分类:移动开发   时间:2014-07-28 11:27:20    阅读次数:331
Android开发之AudioManager(音频管理器)详解
AudioManager类提供了访问音量和振铃器mode控制。使用Context.getSystemService(Context.AUDIO_SERVICE)来得到这个类的一个实例。...
分类:移动开发   时间:2014-07-28 00:17:19    阅读次数:592
Android学习之Notification
Notification可以在手机的状态栏发出一则通知,它需要用NotificationManager来管理,实现Notification其实很简单。1.通过getsystemservice方法获得一个Notificationmanager对象NotificationManager notifica...
分类:移动开发   时间:2014-07-26 00:07:46    阅读次数:325
隐藏输入法
InputMethodManager manager = (InputMethodManager) mContext .getSystemService(Context.INPUT_METHOD_SERVICE); if (((Activity) mContext).getW...
分类:其他好文   时间:2014-07-23 12:58:46    阅读次数:178
android 实现桌面显示内容
//获取windowmanager 对象WindowManager wm = (WindowManager) getApplicationContext().getSystemService(WINDOW_SERVICE);//初始化桌面需显示的视图 View view = LayoutInfla....
分类:移动开发   时间:2014-07-22 00:17:35    阅读次数:195
Android 监控网络状态
Html代码publicstaticbooleanisNetworkAvailable(Contextcontext){ConnectivityManagerconnectivity=(ConnectivityManager)context.getSystemService(Context.CONN...
分类:移动开发   时间:2014-07-21 23:31:03    阅读次数:243
396条   上一页 1 ... 34 35 36 37 38 ... 40 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!