18 |
import android.text.Editable; |
import android.text.Editable; |
19 |
import android.text.TextWatcher; |
import android.text.TextWatcher; |
20 |
import android.util.Log; |
import android.util.Log; |
|
import android.view.KeyEvent; |
|
21 |
import android.view.Menu; |
import android.view.Menu; |
22 |
import android.view.MenuItem; |
import android.view.MenuItem; |
23 |
import android.view.View; |
import android.view.View; |
24 |
import android.widget.EditText; |
import android.widget.EditText; |
25 |
import android.widget.ListView; |
import android.widget.ListView; |
26 |
import android.widget.SimpleCursorAdapter; |
import android.widget.SimpleCursorAdapter; |
|
import android.widget.TextView; |
|
|
import android.widget.TextView.OnEditorActionListener; |
|
27 |
|
|
28 |
public class PeopleList extends ListActivity { |
public class PeopleList extends ListActivity { |
29 |
|
|
54 |
|
|
55 |
|
|
56 |
adapter = new SimpleCursorAdapter(this, |
adapter = new SimpleCursorAdapter(this, |
57 |
R.layout.row, // Use a template |
R.layout.row, // Use this template |
58 |
// that displays a |
null , // Give the cursor to the list adapter |
59 |
// text view |
new String[] { "name", "inits", "company" }, // Map the named db columns ... |
60 |
null , // Give the cursor to the list adatper |
new int[] {R.id.name, R.id.init, R.id.company}); // To these textviews |
|
new String[] { "name", "inits", "company" }, // Map the NAME column in the |
|
|
// people database to... |
|
|
new int[] {R.id.name, R.id.init, R.id.company}); // The "text1" view defined in |
|
|
// the XML template |
|
61 |
|
|
62 |
setListAdapter( adapter ) ; |
setListAdapter( adapter ) ; |
63 |
|
|