How to avoid `Activity pause timeout for ActivityRecord` error?

Viewed 18536

WAY1:

@Override
protected void onPause() {
    super.onPause();
    // do something urgent
    doSomething();
}

WAY2:

@Override
protected void onPause() {
    // do something urgent
    doSomething();
    super.onPause();
}

The difference is the calling sequence of doSomething() and super.onPause(). When I use the WAY1, if the doSomething() cost too much, i will get the error: W/ActivityManager( 4347): Activity pause timeout for ActivityRecord .

Do i avoid the pause timeout error if i use WAY2 ?

I checked the AOSP , but it's too hard for me to understand the invoking procedure of Activity.

2 Answers
Related