Implementing LoaderCallbacks in Activity Android

后端 未结 1 1824
走了就别回头了
走了就别回头了 2020-12-18 16:00

I\'m new in android. I want to get contacts data using loaderCallbacks I write some code but here is some problem I don\'t know why this happen Can

相关标签:
1条回答
  • 2020-12-18 16:46

    Since you're using AppCompatActivity and calling getSupportLoaderManager(), i suppose you would like to use the support library implementation of Loader as well.

    If so, change the following of your import statements:

    import android.app.LoaderManager;
    import android.content.CursorLoader;
    import android.content.Loader;
    

    To this:

    import android.support.v4.app.LoaderManager;
    import android.support.v4.content.CursorLoader;
    import android.support.v4.content.Loader;
    

    If you do not, call getLoaderManager() instead of getSupportLoaderManager().

    0 讨论(0)
提交回复
热议问题