我从这样的Listview
sqlite
获取database
数据
ArrayAdapter<String> aa;
ArrayList<String> arrayList = new ArrayList<String>();
aa = new ArrayAdapter<String>(getActivity(),
R.layout.row_listview, arrayList);
setListAdapter(aa);
Cursor cursor8 = db.rawQuery("SELECT * FROM test21", null);
if(cursor8.getCount() == 0)
{
textView5.setVisibility(View.VISIBLE);
}cursor8.close();
Cursor cursor = db.rawQuery("SELECT * FROM test21", null);
// Toast.makeText(myContext, ""+cursor.getCount(), Toast.LENGTH_LONG).show();
if(cursor.moveToFirst())
{
do {
arrayList.add(cursor.getString(3));
}
while (cursor.moveToNext());
}
当我点击另一个按钮时,它会删除sqlitedatabase
。
我如何refresh
listview
的内容,因为现在什么都没有。我总是需要每次回到activity
:(