Android英文文档翻译系列(6)——LocalBroadcastManager
public class
LocalBroadcastManager
extends Object
| java.lang.Object | |
| ↳ | android.support.v4.content.LocalBroadcastManager | 
Class Overview
Helper to register for and send broadcasts of Intents to local objects within your process. This is has a number of advantages over sending global broadcasts withsendBroadcast(Intent):
- You know that the data you are broadcasting won't leave your app, so don't need to worry about leaking private data.
 - It is not possible for other applications to send these broadcasts to your app, so you don't need to worry about having security holes they can exploit.
 - It is more efficient than sending a global broadcast through the system.
 
Summary
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| static LocalBroadcastManager | getInstance(Context context) | ||||||||||
| void | registerReceiver(BroadcastReceiver receiver, IntentFilter filter)
 Register a receive for any local broadcasts that match the given IntentFilter. 
 | 
||||||||||
| boolean | sendBroadcast(Intent intent)
 Broadcast the given intent to all interested BroadcastReceivers. 
 | 
||||||||||
| void | sendBroadcastSync(Intent intent)
 Like  
sendBroadcast(Intent), but if there are any receivers for the Intent this function will block and immediately dispatch them before returning. | 
||||||||||
| void | unregisterReceiver(BroadcastReceiver receiver)
 Unregister a previously registered BroadcastReceiver. 
 | 
||||||||||
| [Expand]
 Inherited Methods 
 | 
|||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
  From class java.lang.Object
 | 
|||||||||||
Public Methods
public void registerReceiver (BroadcastReceiver receiver, IntentFilter filter)
Register a receive for any local broadcasts that match the given IntentFilter.
Parameters
| receiver | The BroadcastReceiver to handle the broadcast. | 
|---|---|
| filter | Selects the Intent broadcasts to be received. | 
public boolean sendBroadcast (Intent intent)
Broadcast the given intent to all interested BroadcastReceivers. This call is asynchronous; it returns immediately, and you will continue executing while the receivers are run.
Parameters
| intent | The Intent to broadcast; all receivers matching this Intent will receive the broadcast. | 
|---|
public void sendBroadcastSync (Intent intent)
Like sendBroadcast(Intent), but if there are any receivers for the Intent this function will block and immediately dispatch them before returning.
public void unregisterReceiver (BroadcastReceiver receiver)
Unregister a previously registered BroadcastReceiver. All filters that have been registered for this BroadcastReceiver will be removed.
Parameters
| receiver | The BroadcastReceiver to unregister. | 
|---|
Android英文文档翻译系列(6)——LocalBroadcastManager的更多相关文章
- Android英文文档翻译系列(1)——AlarmManager
		
原文:个人翻译,水平有限,欢迎看官指正. public class Ala ...
 - Android英文文档翻译系列(5)——VPNService
		
API14位于android.net.VpnService 类概述|Class OverviewVpnService is a base class for applications to ext ...
 - Android英文文档翻译系列(4)——PopupWindow
		
public class PopupWindow extends Object //直接继承至Object java.lang.Object ↳ android.widget.PopupWindow ...
 - Android英文文档翻译系列(3)——AsyncTask
		
AsyncTask——异步任务 个人认为这是翻译比较好的一次.. Class Overview//类概述 AsyncTask enables proper and easy use of th ...
 - Android英文文档翻译系列(2)——HandlerThread
		
public class HandlerThread extends Thread Class Overview Handy class for starting a new threa ...
 - Android进阶——多线程系列之Thread、Runnable、Callable、Future、FutureTask
		
多线程一直是初学者最抵触的东西,如果你想进阶的话,那必须闯过这道难关,特别是多线程中Thread.Runnable.Callable.Future.FutureTask这几个类往往是初学者容易搞混的. ...
 - Android提升篇系列:Activity recreate(Activity 重新创建/自我恢复)机制(一)
		
注:本文中的recreate是指当内存不足时,Activity被回收,但再次来到此Activity时,系统重新恢复的过程.例如:当Activity A到Activity B时,如果内存不足,A被回收, ...
 - Android控件系列之RadioButton&RadioGroup(转)
		
学习目的: 1.掌握在Android中如何建立RadioGroup和RadioButton 2.掌握RadioGroup的常用属性 3.理解RadioButton和CheckBox的区别 4.掌握Ra ...
 - Android网络编程系列 一 TCP/IP协议族
		
在学习和使用Android网路编程时,我们接触的仅仅是上层协议和接口如Apache的httpclient或者Android自带的httpURlconnection等等.对于这些接口的底层实现我们也有必 ...
 
随机推荐
- JDBC删除数据库实例
			
在本教程将演示如何在JDBC应用程序中删除一个指定的数据库. 在执行以下示例之前,请确保您已经准备好以下操作: 具有数据库管理员权限,以在给定模式中创建数据库. 要执行以下示例,需要用实际用户名和密码 ...
 - unity执行顺序问题(如何再次执行start方法)
			
2016-09-08 20:13 2084人阅读 评论(1) 收藏 举报 分类: unity3D(66) 版权声明:本文为博主原创文章,未经博主允许不得转载. unity执行顺序的文章已经很多了, ...
 - (转) 解密H264、AAC硬件解码的关键扩展数据处理
			
出自:http://blog.itpub.net/30168498/viewspace-1576794/ 通过上一篇文章,我们用ffmpeg分离出一个多媒体容器中的音视频数据,但是很可能这 ...
 - (转)YV12,I420,YUV420P的区别
			
YV12和I420的区别 一般来说,直接采集到的视频数据是RGB24的格式,RGB24一帧的大小size=width×heigth×3 Bit,RGB32的size=width×heigth×4, ...
 - mothur trim.seqs 去除PCR引物
			
trim.seqs 有以下几个主要应用: 1)根据barcode 拆分序列: 2)去除PCR引物 3) 去除低质量序列 trim.seqs 在使用时必须输入一个fasta 格式的序列,然后在加至少一个 ...
 - MySQL提示“错误2:系统找不到指定文件”
			
一.问题原因 个人猜测可能是因为安装的是绿色版MySQL,然后在系统变量path中加入了解压后的路径.后续操作上没有跳转到解压后的路径,而是直接在cmd的默认路径下新建MySQL的服务,所以导致此问题 ...
 - 令人惊叹的HTML5动画及源码分析下载
			
HTML5非常酷,利用HTML5制作动画简直让我们忘记了这世界上还有flash的存在.今天我们要分享的一些HTML5动画都还不错,有些动画设计还是挺别出心裁的.另外,每一款HTML5动画都提供源代码下 ...
 - shell脚本重启tomcat
			
1. 新建shell空脚本文件,如 /home/tr.sh,并设置权限 # chmod 750 /home/tr.sh 2. 设置文件形式: # sed -e 's/\^M//g' /home/tr. ...
 - ASP.NET C# 登陆窗体 限制用户名只输入字母 数字以及下划线
			
文本框的输入限制,我们主要集中两个问题: 一.怎样限制用户名输入的长度? 答:设置txtName的属性 MaxLength="; (我们这里以10个字符为例) 二.怎样限制用户名只输入字母 ...
 - [mobile angular ui]MAUI中的font awesome图标
			
MAUI中用font awesome替换了glyphicon,但是FA中都有哪些可用的图标呢,在网上搜了一张font awesome的对照表,使用时记着把其中的icon-xxx替换为fa-xxx就可以 ...
 
			
		
 From class