您的位置:首页 > 移动开发 > Android开发

Android 开发文档 程序基础 ——Broadcast receivers组件

2010-06-19 10:46 615 查看
Broadcast receivers只接受广播通知并做出反应的组件。广播通知往往来自系统,比如时区改变,语言改变。extends自BroadcastReceiver基类。

一个程序可以有好几个
Broadcast
receivers来接受它认为重要的通知。

Broadcast receivers没有用户界面,但是可以打开一个activity来对接受到的信息做出反应,或者利用NotificationManager来警告用户。
Notifications
可以用很多方法来引起用户的注意,一般是在状态栏显示一个图标,以便用户打开信息。

转自我的android博客

原文

Broadcast receivers
A 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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: