10.1 Binder与SystemService
在我们编写APP程序的时候, 经常会是用getSystemService( String serviceName ) 这个方法,来获取一个系统的服务对象。我们查看源码:
frameworks/base/core/java/android/app下ContextImpl.java ,可以看到SystemService可以通过在...
分类:
其他好文 时间:
2016-05-12 20:28:59
阅读次数:
194
Notification 通知栏通知Notification是显示手机状态栏的文本消息的提示。如何实现: 获取NotificationManager NotificationManager mn = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); 显示通知栏 notify(id,notification)...
分类:
其他好文 时间:
2016-05-12 18:49:35
阅读次数:
136
丰富你的程序,运用手机多媒体使用通知
通知(Notification)是Android系统中比较有特色的一个功能,当某个应用程序希望向用户发出一些,而该应用程序又不在前台运行时,就可以借助通知来实现。
通知的基本用法
首先需要一个NotificationManager来对通知进行管理,可以调用Context的getSystemService()方法获取到。getSystemService()接收的参...
分类:
移动开发 时间:
2016-05-12 11:53:10
阅读次数:
177
http://blog.sina.com.cn/s/blog_71d1e4fc0100o8qr.html http://blog.csdn.net/bianhaohui/article/details/6220135 android的后台运行在很多service,它们在系统启动时被SystemSer ...
分类:
移动开发 时间:
2016-05-11 13:07:32
阅读次数:
187
电话服务
对电话进行监听:
1.使用getSystemService()方法可以取得Context.TELEPHONY_SERVICE服务,取得的服务对象类型为android.telephony.TelephonyManager.
Listen()方法是比较重要的一个方法,通过此方法可以绑定一个PhoneStateListener类的对象,以完成对电话各个状态的监听,在此类中,主要是通过onC...
分类:
移动开发 时间:
2016-05-09 07:00:51
阅读次数:
385
Instantiates a layout XML file into its corresponding View objects. It is never used directly. Instead, use getLayoutInflater() or getSystemService(St ...
分类:
其他好文 时间:
2016-05-07 18:19:50
阅读次数:
157
安卓使用Alarm实现一个简单的定时刷新和周期刷新的定时器alarmManger的获得
AlarmManger am= Context.getSystemService(Context.ALARM_SERVICE)一般实现定时器是通过广播的形式进行的。1。定时刷新 只刷新一次
首先要发送一个广播 PendingTintent.getBroadcast()就类似于一个sendBroadcas...
分类:
其他好文 时间:
2016-05-07 08:37:15
阅读次数:
138
简单记录 通知上的设置方法,没有示例
//进度 通知
notificationManager = (NotificationManager)
context.getSystemService(Context.NOTIFICATION_SERVICE);
builder = new NotificationC...
分类:
移动开发 时间:
2016-05-06 15:25:01
阅读次数:
204
一、剪切板的使用介绍 1. 剪切板对象的创建 使用剪切板会用到,ClipboardManager对象,这个对像的创建不可以使用构造方法,主要是由于没有提供public的构造函数(单例模式),需要使用Activity.getSystemService(Context.CLIPBOARD_SERVICE ...
分类:
移动开发 时间:
2016-05-04 21:16:02
阅读次数:
269
// 判断网络连接是否正常 public static boolean isNetworkAvailable(Context context) { ConnectivityManager cm = (ConnectivityManager) context .getSystemService(Con ...
分类:
其他好文 时间:
2016-05-04 21:04:39
阅读次数:
153