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

What is a Stic...

Câu trả lời

A Sticky Broadcast is a special type of broadcast in Android where the sent Intent object remains in a cache even after the broadcast is complete. The system may re-broadcast sticky Intents to later registrations of receivers[1][2].

Some key points about Sticky Broadcasts:

  • They allow communication between a function and a service[1]
  • They are sent using sendStickyBroadcast() which performs a sendBroadcast(Intent) known as sticky[1]
  • The Intent stays around after the broadcast is complete, so others can quickly retrieve that data through the return value of registerReceiver(BroadcastReceiver, IntentFilter)[1]
  • For example, you can use a sticky broadcast for ACTION_BATTERY_CHANGED to get battery change events without registering for all future state changes[1]

However, sticky broadcasts have some security issues[2]:

  • They cannot be res...
senior

senior

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

junior

What is View Group? How are they different from Views?

senior

What is Doze? What about App Standby?

junior

Is it possible to implement the Model–View–Controller pattern in Java for Android?

Bình luận

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

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