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