26 SearchView and SharedPreferences

Your next task with PhotoGallery is to search photos on Flickr. You will learn how to integrate search into your app using SearchView. SearchView is an action view class – a view that can be embedded right in your Toolbar. You will also learn how to easily store data to the device’s filesystem using SharedPreferences.

By the end of this chapter, the user will be able to press on the SearchView, type in a query, and submit it. Submitting the query will send the query string to Flickr’s search API and populate the RecyclerView with the search results (Figure 26.1). The query string itself will be persisted to the filesystem. This means the user’s last query will be accessible across restarts of ...

Get Android Programming: The Big Nerd Ranch Guide, 4th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.