Android Programming The Big Nerd Ranch Guide, 3rd Edition
317 17. Two-Pane Master-Detail Interfaces In this chapter, you will create a tablet interface for CriminalIntent that allows use ...
Chapter 17 Two-Pane Master-Detail Interfaces 318 You will need a tablet device or AVD for testing in this chapter. To create a ...
Adding Layout Flexibility 319 Adding Layout Flexibility On a phone, you want CrimeListActivity to inflate a single-pane layout, ...
Chapter 17 Two-Pane Master-Detail Interfaces 320 Modifying SingleFragmentActivity CrimeListActivity is a subclass of SingleFrag ...
Creating a layout with two fragment containers 321 Creating a layout with two fragment containers In the project tool window, ri ...
Chapter 17 Two-Pane Master-Detail Interfaces 322 Run CriminalIntent on a tablet device and confirm that you have two panes (Fig ...
Using an alias resource 323 Using an alias resource An alias resource is a resource that points to another resource. Alias resou ...
Chapter 17 Two-Pane Master-Detail Interfaces 324 Creating tablet alternatives Because your alias is in res/values/, it is the d ...
Activity: Fragment Boss 325 Android does not provide a way to use a resource only when a device is under a particular size, but ...
Chapter 17 Two-Pane Master-Detail Interfaces 326 Fragment callback interfaces To delegate functionality back to the hosting act ...
Fragment callback interfaces 327 In CrimeListFragment.java, add a Callbacks interface to CrimeListFragment. Also add an mCallbac ...
Chapter 17 Two-Pane Master-Detail Interfaces 328 Next, in CrimeListActivity, implement CrimeListFragment.Callbacks. Leave onCri ...
Fragment callback interfaces 329 In CrimeListActivity.java, implement onCrimeSelected(Crime) to handle the selection of a crime ...
Chapter 17 Two-Pane Master-Detail Interfaces 330 Run CriminalIntent on a tablet. Create a new crime, and a CrimeFragment will b ...
Fragment callback interfaces 331 Before you start with CrimeFragment’s interface, change the visibility of CrimeListFragment.upd ...
Chapter 17 Two-Pane Master-Detail Interfaces 332 Now implement CrimeFragment.Callbacks in CrimeListActivity to reload the list ...
Fragment callback interfaces 333 Then add calls in CrimeFragment.java to updateCrime() when a Crime’s title or solved status has ...
Chapter 17 Two-Pane Master-Detail Interfaces 334 You also need to call updateCrime() in onActivityResult(...), where the Crime’ ...
For the More Curious: More on Determining Device Size 335 For the More Curious: More on Determining Device Size Before Android 3 ...
...
«
13
14
15
16
17
18
19
20
21
22
»
Free download pdf