I need to access a database from within an arrayAdapter class I am using to populate a custom ListView. However, the startmanagingcursor is undefined for ArrayAdapters.
Here is a code snippet:
DB myDb= new DB(this);
myDb.open();
Cursor c = myDb.getInfo(sillyString);
startManagingCursor(c);
The
startManagingCursor()-method is deprecated anyways. If you’re targeting Devices with Android 3.0 you can use a CurserLoader.If not, you may want to create the cursor for a global object and close it in your
onStop-method.