My application is randomly pausing (going into the onPause method) then resuming (going into the onResume method) when I'm not even touching the screen. In logcat, there is no indication what is causing the pause and resume. This only happens on a Galaxy Tab 7" and not on a Motorola Xoom or HTC Legend.
How can I determine the reason for a pause?
During normal app use, the foreground activity is sometimes obstructed by other visual components that cause the activity to pause. For example, when a semi-transparent activity opens (such as one in the style of a dialog), the previous activity pauses.
As your activity enters the paused state, the system calls the onPause () method on your Activity, which allows you to stop ongoing actions that should not continue while paused (such as a video) or persist any information that should be permanently saved in case the user continues to leave your app.
When you tap the Phone icon to dial a number on your Android phone, the number is instantly spewed into the phone system, like water out of a hose. If you need to pause the number as it’s dialed, you need to know how to insert secret pause characters.
onPause() Method In Android Activity Life Cycle: When Activity is in background then onPause() method will execute. Activity is not visible to user and goes in background when onPause() method is executed.
You stated that it only happens only on the Galaxy Tab. I would hypothesize there is another app running on the device that frequently adds an invisible overlay. If this overlay is on the foreground, it would trigger the onPause()
in your app.
You can use Android Instrumentation to monitor Activity launches by the use of ActivityMonitor. I believe you can even use it to prevent certain Activity from launching.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With