Android Programming The Big Nerd Ranch Guide by Bill Phillips, Chris Stewart, Kristin Marsicano (z-lib.org)
Passing handlers Before running PhotoGallery and seeing your hard-won images, there is one last danger you need to account for. ...
Chapter 26 Loopers, Handlers, and HandlerThread For the More Curious: AsyncTasks vs Threads Now that you understand Handler and ...
For the More Curious: StrictMode In PhotoAdapter.onBindViewHolder(...), you would replace the existing code with a call through ...
Chapter 26 Loopers, Handlers, and HandlerThread Challenge: Preloading and Caching Users accept that not everything can be insta ...
27. Search Your next task with PhotoGallery is to search photos on Flickr. You will learn how to integrate search into your app ...
Chapter 27 Search The method is set to flickr.photos.search. A new parameter, text, is added and set to whatever string you are ...
Searching Flickr Rename fetchItems() to downloadGalleryItems(String url) to reflect its new, more general purpose. It no longer ...
Chapter 27 Search Now add methods to kick off the download by building a URL and calling downloadGalleryItems(String). Listing ...
Searching Flickr You need to update your fragment code to reflect the refactoring you just completed in FlickrFetchr. Open Photo ...
Chapter 27 Search Run PhotoGallery and see what you get. Hopefully, you will see a cool robot or two (Figure 27.2). Figure 27.2 ...
Using SearchView Next, create a new menu XML file for PhotoGalleryFragment in res/menu/ fragment_photo_gallery.xml. This file wi ...
Chapter 27 Search Finally, open PhotoGalleryFragment. Add a call to setHasOptionsMenu(true) in onCreate(...) to register the fr ...
Using SearchView Fire up PhotoGallery and see what the SearchView looks like. Pressing the search icon expands the view to displ ...
Chapter 27 Search Responding to SearchView user interactions When the user submits a query, your app should execute a search ag ...
Responding to SearchView user interactions The onQueryTextSubmit(String) callback is executed when the user submits a query. The ...
Chapter 27 Search Simple Persistence with Shared Preferences The last piece of functionality you need to add is to actually use ...
Simple Persistence with Shared Preferences Getting a value you previously stored is as simple as calling SharedPreferences.getSt ...
Chapter 27 Search Next, clear the stored query (set it to null) whenever the user selects the Clear Search item from the overfl ...
Simple Persistence with Shared Preferences Last, but not least, update FetchItemsTask to use the stored query rather than a hard ...
Chapter 27 Search Polishing Your App For a little bit of polish, pre-populate the search text box with the saved query when the ...
«
23
24
25
26
27
28
29
30
31
32
»
Free download pdf