Android Developer Question:
Download Questions PDF

Please explain what is a Sticky Intent?

Answer:

Sticky Intents allows communication between a function and a service. sendStickyBroadcast() performs a sendBroadcast(Intent) known as sticky, i.e. the Intent you are sending stays around after the broadcast is complete, so that others can quickly retrieve that data through the return value of registerReceiver(BroadcastReceiver, IntentFilter). For example, if you take an intent for ACTION_BATTERY_CHANGED to get battery change events: When you call registerReceiver() for that action — even with a null BroadcastReceiver — you get the Intent that was last Broadcast for that action. Hence, you can use this to find the state of the battery without necessarily registering for all future state changes in the battery.

Download Android Developer Interview Questions And Answers PDF

Previous QuestionNext Question
Do you know what is an Action?Tell us why would you do the setContentView() in onCreate() of Activity class?