Ejemplo n.º 1
0
  /** Called when the activity is first created. */
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    // открываем подключение к БД
    db = new DB(this);
    db.open();
    cursor = db.getAllData();
    startManagingCursor(cursor);
  }
Ejemplo n.º 2
0
 @Override
 public void onClick(DialogInterface dialog, int which, boolean isChecked) {
   ListView lv = ((AlertDialog) dialog).getListView();
   Log.d(LOG_TAG, "which = " + which + ", isChecked = " + isChecked);
   db.changeRec(which, isChecked);
   cursor.requery();
 }
Ejemplo n.º 3
0
 protected void onDestroy() {
   super.onDestroy();
   db.close();
 }