15.03.2017 Views

0321956567

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Getting the Goods ..................................................... 179<br />

The Sneaky Shortcut ................................................ 180<br />

That’s It! ............................................................. 180<br />

Show Me the Map! .................................................. 181<br />

Before We Get Started ................................................ 181<br />

Getting the Library ................................................... 181<br />

Adding to the Manifest ............................................... 183<br />

Adjusting the Activity ................................................ 184<br />

Creating a MapFragment ............................................ 184<br />

Google Maps API Key ................................................. 185<br />

Run, Baby, Run ........................................................ 187<br />

Wrapping Up ........................................................ 189<br />

Chapter 10 Tablets, Fragments, and Action Bars, Oh My ......... 190<br />

Fragments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192<br />

The Lifecycle of the Fragment ........................................ 192<br />

Creating a Fragment ................................................. 193<br />

Showing a Fragment ................................................. 194<br />

Providing Backward Compatibility .................................. 198<br />

The Action Bar ..................................................... 200<br />

Setting Up the AppCompat library .................................. 200<br />

Showing the Action Bar ............................................. 204<br />

Adding Elements to the Action Bar ................................. 204<br />

Wrapping Up ....................................................... 209<br />

Chapter 11 Advanced Navigation . .................................... 210<br />

The View Pager ...................................................... 212<br />

Creating the Project .................................................. 212<br />

onCreate .............................................................. 213<br />

The XML .............................................................. 215<br />

FragmentPagerAdapter .............................................. 215<br />

DummyFragment ..................................................... 217<br />

The Navigation Drawer ............................................. 217<br />

onCreate .............................................................. 218<br />

The XML .............................................................. 221<br />

Swapping Fragments ................................................ 222<br />

Wrapping Up ........................................................ 223<br />

x<br />

Contents

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!