Objectives
In this chapter you’ll:
Use a ListFragment
to display and manage a ListView
.
Use FragmentTransaction
s and the back stack to dynamically attach Fragment
s to and detach Fragment
s from the GUI.
Create and open SQLite databases using a SQLiteOpenHelper
, and insert, delete and query data in a SQLite database using a SQLiteDatabase
object
Use a SimpleCursorAdapter
to bind database query results to a ListView
’s items.
Use a Cursor
to manipulate database query results.
Use multithreading and AsyncTask
s to perform database operations outside the GUI thread and maintain application responsiveness.
Define styles containing common GUI attributes and values, then apply them to multiple GUI components.
8.2 Test-Driving the Address Book App
8.3.1 Displaying Fragment
s with FragmentTransaction
s
8.3.2 Communicating Data Between a Fragment
and a Host Activity
8.3.3 Method onSaveInstanceState
8.3.4 Defining Styles and Applying Them to GUI Components
8.3.5 Specifying a Background for a TextView
8.3.6 Extending Class ListFragment
to Create a Fragment
That Contains a ListView
8.3.7 Manipulating a SQLite Database
8.3.8 Performing Database Operations Outside the GUI Thread with AsyncTask
s
8.4 Building the GUI and Resource Files
8.4.2 Creating the App’s Classes
8.4.6 MainActivity
’s Layout: activity_main.xml
8.4.7 DetailsFragment
’s Layout: fragment_details.xml
8.4.8 AddEditFragment
’s Layout: fragment_add_edit.xml
8.4.9 Defining the Fragments
’ Menus
8.9 DatabaseConnector
Utility Class
Self-Review Exercises | Answers to Self-Review Exercises | Exercises