码迷,mamicode.com
首页 >  
搜索关键字:getsystemservice    ( 396个结果
真机测试报错ERROR/AndroidRuntime(1805): java.lang.Runtim
这个错误是和调用相机摄像头相关的。 产生这个错误的原因主要在于代码控制分辨率的显示和真机测试分辨率不一样。 ? 一:解决办法? ? ?? WindowManager wm =(WindowManager) getSystemService(Context.WINDO...
分类:移动开发   时间:2014-11-06 17:55:20    阅读次数:142
android 判断屏幕是否亮着
PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE); boolean screen = pm.isScreenOn();
分类:移动开发   时间:2014-11-06 16:42:35    阅读次数:165
Android Receiver(听筒模式和扬声器模式)
切换为听筒模式声音由听筒发出 am = (AudioManager)getSystemService(Context.AUDIO_SERVICE);//听筒模式 切换为正常模式 am.setMode(AudioManager.MODE_NORMAL); //正常模式 判断是否为扬声器 am.isSpeakerphoneOn(); 权限...
分类:移动开发   时间:2014-10-31 10:09:42    阅读次数:1225
android获取inflater
LayoutInflater作用是将layout的xml布局文件实例化为View类对象。获取LayoutInflater的方法有如下三种:?LayoutInflater inflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_...
分类:移动开发   时间:2014-10-30 14:47:06    阅读次数:210
popupwindow popupmenu
private void iniPopupWindow() { ??LayoutInflater inflater = (LayoutInflater) this?.getSystemService(LAYOUT_INFLATER_SERVICE); ??View layout = inflater.inflate(R.layout.task_detail_popupwindow...
分类:Windows程序   时间:2014-10-29 19:52:46    阅读次数:282
Android如何在activity中控制屏幕点亮与关闭
Android中通过各种Lock锁对电源进行控制,需要注意的是加锁和解锁必须成对出现。 //启用屏幕常亮功能 PowerManager pm =(PowerManager) getSystemService(POWER_SERVICE); wakeLock= pm.newWakeLock(PowerManager.FULL_WAKE_LOCK| PowerManager.ACQUIRE_CAUS...
分类:移动开发   时间:2014-10-28 21:51:00    阅读次数:170
LayoutInflater.inflate详解
###介绍常见inflate方法 在日常开发中经常会用到通过资源id去获取view的场景,我们通常有四种方式去获取view,分别是以下四种: ``` //1,通过系统服务获取布局加载器 LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);...
分类:其他好文   时间:2014-10-24 19:01:27    阅读次数:216
Android 读取MCC, MNC
TelephonyManager telManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); /**获取SIM卡的IMSI码 * SIM卡唯一标识:IMSI 国际移动用户识别码(IMSI:Internati...
分类:移动开发   时间:2014-10-24 10:49:16    阅读次数:279
inflate()和findViewById()
1.findViewById()是View对象的方法,先通过inflate()方法得到View,调用这个View对象的getViewById()方法,就能得到这个View树上的子View。 2.inflate()函数可以通过getSystemService()方法得到,参数是LAYOUT_INFLATER_SERVICE。 3.inflate()函数的第一个参数是布局文件的R引用,第二...
分类:其他好文   时间:2014-10-22 10:07:31    阅读次数:176
android中getSystemService详解
android的后台运行在很多service,它们在系统启动时被SystemServer开启,支持系统的正常工作,比如MountService监 听是否有SD卡安装及移除,ClipboardService提供剪切板功能,PackageManagerService提供软件包的安装移除及查看等 等,.....
分类:移动开发   时间:2014-10-21 15:00:44    阅读次数:190
396条   上一页 1 ... 28 29 30 31 32 ... 40 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!