public void next(int id) { if (!DbAdapter.is_open) { dbadapter.open(); } lista.clear(); lista.addAll(dbadapter.searchRowCatName(id)); adapter.notifyDataSetChanged(); dbadapter.close(); }
public void onCreate(Bundle icicle) { super.onCreate(icicle); dbadapter = new DbAdapter(getApplicationContext()); if (!DbAdapter.is_open) { dbadapter.open(); } getActionBar().setDisplayHomeAsUpEnabled(true); int element = 0; lista = dbadapter.searchRowCatName(element); dbadapter.close(); adapter = new Cele_Cats_Adapter(this, lista); adapter.notifyDataSetChanged(); getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE); setListAdapter(adapter); }