title: How to avoid `Activity pause timeout for ActivityRecord` error?
body: <p>WAY1:</p>
  
  <pre><code>@Override
  protected void onPause() {
      super.onPause();
      // do something urgent
      doSomething();
  }
  </code></pre>
  
  <p>WAY2:</p>
  
  <pre><code>@Override
  protected void onPause() {
      // do something urgent
      doSomething();
      super.onPause();
  }
  </code></pre>
  
  <p>The difference is the calling sequence of <code>doSomething()</code> and <code>super.onPause()</code>. When I use the <strong>WAY1</strong>, if the <code>doSomething()</code> cost too much, i will get the error: <code>W/ActivityManager( 4347): Activity pause timeout for ActivityRecord</code> . </p>
  
  <p>Do i avoid the <code>pause timeout</code> error if i use <strong>WAY2</strong> ?</p>
  
  <p>I checked the AOSP , but it's too hard for me to understand the invoking procedure of Activity.</p>