getLoaderManager().initLoader() doesn't accept 'this' as argument though the class (ListFragment) implements LoaderManager.LoaderCallbacks

后端 未结 19 1609
无人共我
无人共我 2020-12-07 16:19

I\'m having trouble following a guide on using SQLite in Android. I\'m using a ListFragment instead of a ListActivity(as in the example), so I have

19条回答
  •  太阳男子
    2020-12-07 16:59

    I was having a similar issue where my AsyncTaskLoader was not returning my List, but my resolution was to change the call from .initLoader to .restartLoader.

    So I actually never called .initLoader and just immediately called .restartLoader.

    I had a onListItemClick listener in my fragment and every time backed out of the fragment and reloaded the onListItemClick and navigated through the app it kept crashing.

    It might just be specific to my app but hopefully it helps others if they are having fragment backstack reload issues.

    This was part of a file manager portion in my app so it is specific to clicking multiple onListItemClicks in the fragment you are loading.

提交回复
热议问题