From the course: Android App Development: Working with Widgets

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Overview of broadcast intents

Overview of broadcast intents - Android Tutorial

From the course: Android App Development: Working with Widgets

Start my 1-month free trial

Overview of broadcast intents

- [Instructor] The final element that we need to explore before we get to update our functions to work with our widget are the broadcast intents. These are actions that are broadcasted to indicate an action has been done and that we should update our widget. Pretty much like our methods for our AppWidgetProvider, they have labels that are useful in understanding how you can use them. Again, these intents provide a directive to our method to do something. The first one is ACTION_APPWIDGET_UPDATE, which basically updates the widget, pretty much like what we had for the methods. The second one is APPWIDGET_ENABLED, which is basically called when the widget is created. Then we have the DISABLED, which is called when a widget is removed. And then we have OPTIONS_CHANGED when the widget is resized or placed on the screen, and I don't know about you, but there's a pattern here. It's pretty much the same thing as we had with our methods. And the final one is DELETED, when the widget is…

Contents