Loader load InBAckground is reset when screen turns



  • I have Loader, create and cause it:

    mLoadData = getSupportLoaderManager().initLoader(LOADER_ID, bundle, this);
    mLoadData.onContentChanged();
    

    In the first launch, it's all right: the designer is starting. onStartdoInBackground And at the end, I get the data active. But when I turn the screen, it's reset. loadInBackgroundand then it's twice the method. onLoadFinished Activity. How do you make me get, when I turn the screen, or I get a reference to it? Loaderwhich already exists or has received data through method onLoadFinished (possibly equivalent) which were loaded earlier without reset loadInBackground?



  • According to the https://stackoverflow.com/a/22299373/3212712 docks and common sense onContentChanged() Tells the boater that the data have changed and they need to be downloaded again. I mean, you're gonna have to run a boat by his launch. forceLoad() instead of what you're using. In this case, the boater will not reset after the screen turns and will issue only downloaded data every time, if any.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2