Android SDK 文档说 startManagingCursor()
方法已经过时了:
不推荐使用此方法。使用新的 CursorLoader 类和 LoaderManager; 这也可以通过 Android 兼容性包在较旧的平台上使用。此方法允许活动根据活动的生命周期为您管理给定的 Cursor 的生命周期。也就是说,当活动停止时,它会自动调用给定的游标的反激活() ,当它稍后重新启动时,它会为您调用 request ()。销毁活动后,将自动关闭所有托管游标。如果您的目标是蜂巢或更高版本,可以考虑改用通过 getLoaderManager ()提供的 LoaderManager
所以我想使用 CursorLoader
。但是,当我需要在 CursorLoader
的构造函数中使用 URI 时,如何在没有 ContentProvider
的情况下与自定义 CursorAdapter
一起使用它呢?