I read everywhere that the startManagingCursor method is deprecated and you should use the CursorLoader class.
如果您愿意继承FragmentActivity,您可以使用Android支持包中的Loader框架实现,一直返回到Android 1.6.
话虽如此,Android中的“弃用”通常意味着“我们将继续支持这一点,但是我们认为有更好的解决方案”.您可以在API级别11上使用startManagingCursor().但是,在较旧的和较新的Android版本上,受管游标的问题(尤其是在主应用程序线程上的活动重新启动时它们是否重新启动)仍然存在.
But does that mean that you should use the CursorLoader class even for apps that support API levels < 11?
你当然可以和一切平等,你可能应该.但是,其他所有内容都很少相同,FragmentActivity要求可能是您的一个问题.
如果您正在开发新的应用程序,那么您应该从一开始就考虑片段,在这种情况下,您将使用FragmentActivity,因此使用Loader不应该是一个问题.
I don’t appear to be able to import the cursor loader class with api 4
Loader的Android支持包实现适用于API 4级及以上版本.