What is the reason for deprecating startManagingCursor ?
My simple app has a table view with list of data from DB. So, what I have now in onCreate:
final Cursor cursor = getDataFromDB();
startManagingCursor(cursor);
setListAdapter(new CursorAdapter(cursor));
And thats it, and I dont need to do anything else…
But startManagingCursor is deprecated now, and I should implement LoaderCallbacks , override onCreateLoader, onLoadFinished, onLoaderReset, create ContentProvider fo my DB and so on. But I dont need all this staff, I just need to get few lines of information from DB. How to be ? Why android did that ? Why should I implement all this staff ?
That being said, “deprecated” in Android usually means “we will continue to support this, but we think there are better solutions”.
If you are willing to inherit from FragmentActivity, you can use the Loader framework implementation in the Android Support package, going all the way back to Android 1.6.
You can certainly use startManagingCursor() on API Level 11+. However, the problems with managed cursors (notably that they requery() on an activity restart on the main application thread) are still there, on older and newer Android versions.
Source: Android eclipse startManagingCursor Deprecated but want to support older API versions?