title: LoaderManager's loaders surviving orientation change, but not activity destruction
body: <p>I need to make network calls to a backend JSON API in order to make changes server side when a user updates their profile.</p>
  
  <p>Unfortunately, these asynchronous tasks might get disrupted by Android's inherent lifecycle events. So I opted to use <code>AsyncTaskLoader</code> with <code>getSupportLoaderManager</code></p>
  
  <p>However, I have again run into another problem. Although the loaders contained inside <code>LoaderManager</code> survives orientation changes - they do not survive the destruction of an activity (which is strange because <code>Bundle savedInstanceState</code> does)</p>
  
  <pre><code>// everything is good so far
  LoaderManager.initLoader -&gt; orientation change -&gt; LoaderManager.getLoader(...)      = &lt;Some Loader&gt;
  outState.putString(...)  -&gt; orientation change -&gt; savedInstanceState.getString(...) = &lt;Some String&gt;
  
  // I am having problems now...
  LoaderManager.initLoader -&gt; activity destroyed by OS -&gt; LoaderManager.getLoader(...)      = null
  outState.putString(...)  -&gt; activity destroyed by OS -&gt; savedInstanceState.getString(...) = &lt;Some String&gt;
  </code></pre>
  
  <p><strong>How do I make it so that my <code>LoaderManager</code> (and more importantly the contained loaders) survives along side <code>savedInstanceState</code></strong></p>
  
  <p>The following is a small Android app that illustrates the current issue. Please note that the issue is only prevalent when the developer option (DONT KEEP ACTIVITIES is enabled)</p>
  
  <p><a href="https://anonfile.com/kfTft8d1b0/Android_async_loader_04.rar" rel="nofollow noreferrer">https://anonfile.com/kfTft8d1b0/Android_async_loader_04.rar</a></p>
  
  <ol>
  <li>First click the INIT loader button in the app</li>
  <li>Second click the overview button</li>
  <li>Third re-enter the app</li>
  <li>Fourth click the GET loader button in the app</li>
  <li>Observe the return value is NULL</li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/t4mAyl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/t4mAyl.png" alt="enter image description here"></a></p>