我想在将记录插入到sqllite db后从另一个活动调用listview适配器。如何从另一个活动调用ListView适配器进行刷新 - notifyDataSetChanged()
我无法调用adapter.notifyDataSetChanged()方法。什么是最好的方式来做到这一点。
public void onClick(View v) {
TextView item_name;
item_name=(TextView) findViewById(R.id.eItemName);
Log.d("Insert: ", "Inserting ..");
db.add_item(new Item(item_name.getText().toString()), getApplicationContext());
// I want to call the method HERE!!!!
finish();
}
如果没有该活动的实例,如何更改数据集?您可以手动启动活动,并在活动的onCreate中更新数据库中的列表项。\ – Li3ro 2012-07-21 11:32:56