Android Programming: The Big Nerd Ranch Guide, 2nd Edition
by Bill Phillips, Chris Stewart, Brian Hardy, Kristin Marsicano
25 Search
Your next task with PhotoGallery is to search photos on Flickr. You will learn how to integrate search into your app the Android way. Or, as it turns out, one of the Android ways. Search has been integrated into Android from the very beginning, but it has changed a lot over time.
In this chapter you will implement search using SearchView.
The user will be able to submit a query using the SearchView, which will search Flickr using the query string and populate the RecyclerView with the search results (Figure 25.1). The query string submitted will be persisted to the filesystem. This means the user’s last query will be accessible across restarts of the app and even the device.
Figure 25.1 App preview
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access