This lesson wraps up MP1. Our last step is to get the search bar in our main activity working. But before we do that, we need to discuss the idea of callbacks, a programming pattern central to building user interfaces.
What exactly is Android, and what is a framework? Let's discuss this a bit, since it will help frame our discussion of callbacks that follows.
It's common in user interface programming to need to respond somehow to some interaction that the user has with the display. Maybe they click on something, or push a button, or add text into an input box. A canonical programming pattern for handling these events uses the idea of a callback or callback function. Let's explore that together and it will lead us right to our final task for MP1.
Now let's look at exactly what we need to do to get our search bar to work!
Before we finish, let's apply what we've learned to understanding an unusual piece of code that you may have noticed in the MP starter code.
As a reminder, on lessons where we focus on the machine project we will not assign a homework problem! However, the lesson will usually focus on helping you complete a particular part of the MP test suite, and so we encourage you to spend time on that in lieu of a homework problem.
Need more practice? Head over to the practice page.