Câu hỏi phỏng vấn Android
Câu hỏi

What is the difference between Local , ...

Câu trả lời

Here is the difference between the types of Android broadcasts:

Normal Broadcast:

  • Use sendBroadcast() to send
  • Asynchronous broadcast, any registered receiver can receive it in any order[1][2]

Ordered Broadcast:

  • Use sendOrderedBroadcast() to send
  • Synchronous broadcast, receivers get it one-by-one in priority order
  • Receivers can propagate results or abort the broadcast[1][2][4]

Local Broadcast:

  • Use LocalBroadcastManager to send and receive
  • Optimized for intra-app communication, intents don't cross process boundaries
  • Enhances security by ensuring intents can't be sent/received by other apps[5]

Sticky Broadcast:

  • Use sendStickyBroadcast() to send
  • The broadcast intent stays in a cache after delivery
  • The system re-broadcasts the sticky intent to future registrations
  • Allows quickly retrieving the last sticky broadcast[1][2][3]...
expert

expert

Gợi ý câu hỏi phỏng vấn

middle

What are Android Annotations and what are they used for?

junior

What is Context on Android?

expert

What happens if the user navigates away or closes the app while I still have a reference to the Activity
the user just closed in my AsyncTask ?

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào