2012-10-18 100 views
2

我使用SimpleCursorAdapter來填補我的名單如下:如何讓我的SimpleCursorAdapter自動刷新?

adapter = new SimpleCursorAdapter(this, R.layout.fang_listlayout, 
      MainController.getInstance().getCursor(), 
      new String[] {"Foo", "Foo2"}, 
      new int[] {R.id.foo1, R.id.foo2}, 0); 

現在我要實現,當某事在Cursor改變了我想自動refesh列表中的內容。

該如何實現?

+0

這裏看看:http://stackoverflow.com/questions/5430862/difference-between- contentobserver-and-datasetobserver –

+0

http://stackoverflow.com/a/1986071/1339473 ...只要你通過adatper.requery()進入數據庫這個更新,那麼每次這是更新數據庫 – QuokMoon

回答