startManagingCursor(游标)已弃用的方法

use*_*955 10 java android cursor deprecated

我用过这段代码:

Cursor c = cr.query(message, null, null, null, null);
startManagingCursor(c);
Run Code Online (Sandbox Code Playgroud)

但这startManagingCursor(c)是一种弃用的方法.我该如何更换它?

小智 8

此方法在API级别11中已弃用.请将新的CursorLoader类与LoaderManager一起使用; 这也可以通过Android兼容包在旧版平台上使用.

看看这个教程系列.