If 2 broadcasts, A and B, and sent in that order, does Android guarantee that all interested receivers will receive them in the same order?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I believe you are asking if there is any way to guarantee that each interested receiver will receive its respective Broadcast A before getting Broadcast B. The best answer I can give is that it is highly likely, because all broadcasts are passed to the
ActivityManagerwhich should handle them in turn. But I don’t believe there is anything in the framework that “guarantees” this behavior (I can’t find a queue on ActivityManager where they are all posted or anything like that). Also,BroadcastReceiverwill only handle one Intent at a time, which helps.If instead you meant “can I control the order of receivers in which each broadcast is sent”, then your answer lies with
sendOrderedBroadcast()as other have eluded to.