title: It is now 2018 - Is Activity onStop killable (Not guarantee to be called)
body: <p>now is 2018.</p>
  
  <p>All the while, I save my application data during <code>onPause</code> instead of <code>onStop</code>, because I hold a strong believe <code>onStop</code> is not guarantee to be called.</p>
  
  <p>Source : <a href="https://developer.android.com/reference/android/app/Activity.html" rel="nofollow noreferrer">https://developer.android.com/reference/android/app/Activity.html</a></p>
  
  <p><a href="https://i.stack.imgur.com/9r8Df.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9r8Df.png" alt="enter image description here"></a></p>
  
  <blockquote>
    <p>for those methods that are marked as being killable, after that method
    returns the process hosting the activity may be killed by the system
    at any time without another line of its code being executed. Because
    of this, you should use the onPause() method to write any persistent
    data (such as user edits) to storage.</p>
  </blockquote>
  
  <p>Basically, the table tells</p>
  
  <ol>
  <li>For device honeycomb and above, <code>onPause</code> is not killable. It is guarantee to be called.</li>
  <li>For all devices, <code>onStop</code> is killable. It is <strong>not</strong> guarantee to be called.</li>
  </ol>
  
  <hr>
  
  <p>But, below the table, another line of text broke my strong believe.</p>
  
  <blockquote>
    <p>Starting with Honeycomb, an application is not in the killable state
    until its onStop() has returned.</p>
  </blockquote>
  
  <p>I read the same sentence many times. It means <code>onStop</code> is not killable?! This some how contrary with the above table information.</p>
  
  <h2>Further reading</h2>
  
  <p>I read <a href="https://developer.android.com/guide/components/activities/activity-lifecycle.html#onpause" rel="nofollow noreferrer">https://developer.android.com/guide/components/activities/activity-lifecycle.html#onpause</a> to find out the truth</p>
  
  <blockquote>
    <p>For this reason, you should not use onPause() to save application or
    user data, make network calls, or execute database transactions; such
    work may not complete before the method completes. Instead, you should
    perform heavy-load shutdown operations during onStop().</p>
  </blockquote>
  
  <p>It suggests us to save application data during <code>onStop</code>. Does that mean <code>onStop</code> is always called?</p>
  
  <hr>
  
  <p>My questions are</p>
  
  <ol>
  <li>Is <code>onStop</code> always called? (For Android 4 and above)</li>
  <li>Should application data save operation be performed during <code>onPause</code> or <code>onStop</code>?</li>
  </ol>