Android 开发之Broadcast receivers组件
2010-06-12 19:46:00 来源:WEB开发网Broadcast receivers只接受广播通知并做出反应的组件。广播通知往往来自系统,比如时区改变,语言改变。extends自BroadcastReceiver基类。
一个程序可以有好几个Broadcast receivers来接受它认为重要的通知。
Broadcast receivers没有用户界面,但是可以打开一个activity来对接受到的信息做出反应,或者利用NotificationManager来警告用户。Notifications可以用很多方法来引起用户的注意,一般是在状态栏显示一个图标,以便用户打开信息。
原文
Broadcast receiversA broadcast receiver is a component that does nothing but receive and react to broadcast announcements. Many broadcasts originate in system code — for example, announcements that the timezone has changed, that the battery is low, that a picture has been taken, or that the user changed a language preference. Applications can also initiate broadcasts — for example, to let other applications know that some data has been downloaded to the device and is available for them to use.
An application can have any number of broadcast receivers to respond to any announcements it considers important. All receivers extend the BroadcastReceiver base class.
Broadcast receivers do not display a user interface. However, they may start an activity in response to the information they receive, or they may use the NotificationManager to alert the user. Notifications can get the user’s attention in various ways — flashing the backlight, vibrating the device, playing a sound, and so on. They typically place a persistent icon in the status bar, which users can open to get the message.
- ››Android 当修改一些代码时,使用什么编译命令可以最...
- ››Android 如何添加一个apk使模拟器和真机都编译进去...
- ››Android 修改Camera拍照的默认保存路径
- ››Android 如何修改默认输入法
- ››android开发中finish()和System.exit(0)的区别
- ››Android手势识别简单封装类
- ››android中查看项目数字证书的两种方法
- ››Android中获取IMEI码的办法
- ››android 相机报错 setParameters failed
- ››Android重启运用程序的代码
- ››Android为ListView的Item设置不同的布局
- ››android bitmap与base64字符串的互相转换
更多精彩
赞助商链接