2

i'm using a SimpleCursorAdapter to fill my list like this:

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

now i want to implement, when something in the Cursor changed i want to refesh the list content automatically.

how to implement this?

ania
  • 2,352
  • 1
  • 20
  • 20
gurehbgui
  • 14,236
  • 32
  • 106
  • 178
  • look here: http://stackoverflow.com/questions/5430862/difference-between-contentobserver-and-datasetobserver – Tomislav Novoselec Oct 18 '12 at 09:11
  • http://stackoverflow.com/a/1986071/1339473... whenver u enter into databse this update by adatper.requery() so..every time this is update databse – QuokMoon Oct 18 '12 at 09:14

1 Answers1

1

You can use the managedQuery() and reQuery() methods. But these methods have been depricated. Cause you have another way to manage, cursor and list view, by CursorLoader api, please see following link:

http://developer.android.com/reference/android/content/CursorLoader.html

gurehbgui
  • 14,236
  • 32
  • 106
  • 178
jeet
  • 29,001
  • 6
  • 52
  • 53