8.6. ContactListFragment Class
Class ContactListFragment
(Figs. 8.24–8.33) extends ListFragment
to display the contact list in a ListView
and provides a menu item for adding a new contact.
1 // ContactListFragment.java 2 // Displays the list of contact names 3 package com.deitel.addressbook; 4 5 import android.app.Activity; 6 import android.app.ListFragment; 7 import android.database.Cursor; 8 import android.os.AsyncTask; 9 import android.os.Bundle;10 import android.view.Menu;11 import android.view.MenuInflater;12 import android.view.MenuItem;13 import android.view.View;14 import android.widget.AdapterView;15 import android.widget.AdapterView.OnItemClickListener;16 import android.widget.CursorAdapter; ...
Get Android™ How to Program, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.