Replacement for SimpleCursorAdapter?

前端 未结 1 974
臣服心动
臣服心动 2021-02-08 18:15

I\'m looking at the Notepad Tutorial on the Android developer\'s site and noticed that SimpleCursorAdaptor is deprecated.

The new constructor



        
相关标签:
1条回答
  • 2021-02-08 18:30

    Please note that the deprecation does not apply to all ofSimpleCursorAdapter, just one of the constructors.

    If you wish to use the Loader from API 11, you can pull in the compatibility library (see: http://developer.android.com/sdk/compatibility-library.html). This provides a backport that is compatible with API level 4 or higher devices.

    EDIT :

    If you are still facing the errors after using compatibility library, then you just need to replace

    import android.widget.SimpleCursorAdapter;
    

    with

    import android.support.v4.widget.SimpleCursorAdapter;
    
    0 讨论(0)
提交回复
热议问题