Jon
Jon

Reputation: 121

onStop() Timing out

I have an application that has a while loop in the onStop() method. In the logs I found this line:

07-06 08:35:43.616 W/ActivityManager(  837): Activity stop timeout for ActivityRecord{4271e7f0 u0 com.example.jalexander.copyright/.MainActivity t307}
07-06 08:35:43.616 V/ActivityManager(  837): Moving to STOPPED: ActivityRecord{4271e7f0 u0 com.example.jalexander.copyright/.MainActivity t307} (stop complete)

The application is not completing it's onStop() task, and I am wondering if this may be the cause. Additionally, are there any issues I should be aware of given that my application sort of lingers in onStop() while in the backstack?

Upvotes: 0

Views: 106

Answers (1)

Argyle
Argyle

Reputation: 3394

Make your loop an n of 0 and see if it's still happening. Those lifecycle methods are not intended to do any heavy lifting and the OS is getting grumpy about it. It would be wise to put that loop into an AsyncTask or otherwise trying to find a way to do that work elsewhere.

Upvotes: 1

Related Questions