是否LocalBroadcastManager传递的顺序事件中的事件WER发送? [英] Does LocalBroadcastManager deliver events in the order in which the events wer sent?

查看:179
本文介绍了是否LocalBroadcastManager传递的顺序事件中的事件WER发送?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个活动A和服务S.他们通过LocalBroadcastManager通勤。

I have an activity A and a service S. They commute via LocalBroadcastManager.

若S为了与两个消息M1和M2调用sendBroadcast两次,会前,M2货币供应量M1弄?

If S calls sendBroadcast twice with two messages M1 and M2 in order, will A get M1 before M2?

谢谢,

推荐答案

LocalBroadcastManager 已经为你播放两种方式; sendBroadcast() sendBroadcastSync()。一个是同步的,而另一个是异步的。 sendBroadcastSync()块,直到第一个消息接收器完成运行。

LocalBroadcastManager has two ways for you to broadcast; sendBroadcast() and sendBroadcastSync(). One is synchronous, and the other is asynchronous. sendBroadcastSync() blocks until the receiver for the first message is done running.

这篇关于是否LocalBroadcastManager传递的顺序事件中的事件WER发送?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆