I have an activity that makes use of a surfaceview forced into
landscape mode using "android:screenOrientation="landscape"" in the
manifest file. My concern is related to the use case where the screen
is turned off using the (red) hangup button, where I would assume that
the onPause() method of the activity would be invoked and nothing
else. However as can be seen from the bottom trace, the activity is
cycled twice. I have tried to summarize the relevant part of the trace
- the numbers are marked in the complete bottom trace succeeding an
empty line.

1) onSaveInstanceState() + onPause() are invoked
2) windowManager reports rotation and config changed, causing
surfaceChanged() to be invoked (I assume)
3) onDestroy() is invoked
4) onCreate() is invoked
5) onPause() is invoked
6) onResume() is invoked
7) onSaveInstanceState() + onPause() are invoked

And please note that all this is caused by just one hangup key press -
the handset being a HTC G1 running Android 1.5. I would like some
feedback on the following concerns:

a) Why is the activity being shut down? I would not expect it to be
caused by the rotation/config changed (the handset has not even been
rotated) due to the "screenOrientation=lanscape".
b) Why is the activity being restarted, paused, resumed and then
paused once again?

Google has led me to the following posts that may be dealing with the
same issue, however it seems as no firm conclusion has been drawn:

http://code.google.com/p/android/issues/detail?id=2423
http://www.mail-archive.com/[email protected]/msg58374.html

I hope you can help me here.

Thanks,
Martin

02-28 15:16:11.767: VERBOSE/com.spigo.balloons.GameThread$1(373):
mUpdateTimeTask invoked
02-28 15:16:11.777: VERBOSE/com.spigo.balloons.GameThread(373):
updateVideo:called
02-28 15:16:12.317: VERBOSE/com.spigo.balloons.GameThread$1(373):
mUpdateTimeTask invoked
02-28 15:16:12.317: VERBOSE/com.spigo.balloons.GameThread(373):
updateVideo:called
02-28 15:16:12.847: VERBOSE/com.spigo.balloons.GameThread$1(373):
mUpdateTimeTask invoked
02-28 15:16:12.847: VERBOSE/com.spigo.balloons.GameThread(373):
updateVideo:called
02-28 15:16:12.937: DEBUG/dalvikvm(88): GC(0) freed 21584 objects /
1338416 bytes in 473ms
02-28 15:16:13.377: VERBOSE/com.spigo.balloons.GameThread$1(373):
mUpdateTimeTask invoked
02-28 15:16:13.377: VERBOSE/com.spigo.balloons.GameThread(373):
updateVideo:called
02-28 15:16:13.909: VERBOSE/com.spigo.balloons.GameThread$1(373):
mUpdateTimeTask invoked
02-28 15:16:13.909: VERBOSE/com.spigo.balloons.GameThread(373):
updateVideo:called
02-28 15:16:14.160: DEBUG/WindowManager(88): I'm tired
mEndcallBehavior=0x2
02-28 15:16:14.317: DEBUG/Sensors(88): sensors=00000000, real=00000000
02-28 15:16:14.437: VERBOSE/com.spigo.balloons.GameThread$1(373):
mUpdateTimeTask invoked
02-28 15:16:14.437: VERBOSE/com.spigo.balloons.GameThread(373):
updateVideo:called
02-28 15:16:14.477: DEBUG/AKMD(77): Compass CLOSE

1)
02-28 15:16:14.577: INFO/com.spigo.balloons.Balloons(373):
onSaveInstanceState()::called
02-28 15:16:14.577: INFO/com.spigo.balloons.BalloonsGame(373):
saveState():called
02-28 15:16:14.607: DEBUG/SurfaceFlinger(88): About to give-up screen,
flinger = 0x150c08
02-28 15:16:14.877: INFO/com.spigo.balloons.Balloons(373):
onPause()::called
02-28 15:16:14.877: DEBUG/com.spigo.balloons.GameThread(373):
stopTimeUpdate()
02-28 15:16:14.877: INFO/com.spigo.balloons.BalloonsService$1(373):
Ambient sound task stopped

2)
02-28 15:16:15.047: INFO/WindowManager(88): Setting rotation to 0,
animFlags=0
02-28 15:16:15.067: INFO/WindowManager(88): Config changed:
{ scale=1.0 imsi=0/0 locale=en_US touch=3 key=2/1/2 nav=3 orien=1 }
02-28 15:16:15.097: INFO/WindowManager(88): Config changed:
{ scale=1.0 imsi=0/0 locale=en_US touch=3 key=2/1/2 nav=3 orien=1 }
02-28 15:16:15.287: DEBUG/StatusBar(88): updateResources
02-28 15:16:15.307: DEBUG/UpdateService(32755): rotation
02-28 15:16:15.607: DEBUG/UpdateService(32755): >>> Pure calendar
(176) <<<
02-28 15:16:15.637: WARN/InputManagerService(88): Starting input on
non-focused client android.view.inputmethod.InputMethodManager
$...@439c50c0 (uid=1000 pid=88)
02-28 15:16:15.717: DEBUG/UpdateService(32755): CalendarObserver
Google registered
02-28 15:16:15.767: DEBUG/UpdateService(32755): CalendarObserver
Exchange registered
02-28 15:16:15.797: DEBUG/UpdateService(32755): AstridTasksObserver
registered
02-28 15:16:16.017: DEBUG/com.spigo.balloons.GameView(373):
surfaceChanged()
02-28 15:16:16.017: DEBUG/com.spigo.balloons.GameThread(373):
startTimeUpdate()
02-28 15:16:16.027: DEBUG/dalvikvm(88): GC(2) freed 9765 objects /
498984 bytes in 206ms
02-28 15:16:16.037: DEBUG/UpdateService(32755): GtasksTasksObserver
registered
02-28 15:16:16.037: DEBUG/UpdateService(32755): Requested UPDATE_ALL
action
02-28 15:16:16.037: DEBUG/UpdateService(32755): Requested FORCE_UPDATE
action for widget 0
02-28 15:16:16.047: DEBUG/OpenSSLSessionImpl(88): Freeing OpenSSL
session

3)
02-28 15:16:16.067: INFO/com.spigo.balloons.Balloons(373):
onDestroy()::called
02-28 15:16:16.167: WARN/InputManagerService(88): Starting input on
non-focused client android.view.inputmethod.InputMethodManager
$...@439c50c0 (uid=1000 pid=88)
02-28 15:16:16.177: DEBUG/com.spigo.balloons.GameView(373):
surfaceDestroyed()
02-28 15:16:16.177: DEBUG/com.spigo.balloons.GameThread(373):
setRunning::called mRun = false
02-28 15:16:16.177: DEBUG/com.spigo.balloons.GameThread(373):
setThreadWork():: threadWork=false
02-28 15:16:16.177: DEBUG/com.spigo.balloons.GameThread(373):
stopTimeUpdate()
02-28 15:16:16.177: DEBUG/com.spigo.balloons.GameThread(373):
stopTimeUpdate()
02-28 15:16:16.177: DEBUG/com.spigo.balloons.GameThread(373):
setThreadWork():: threadWork=true
02-28 15:16:16.177: DEBUG/com.spigo.balloons.GameThread(373):
startTimeUpdate()
02-28 15:16:16.187: INFO/ActivityManager(88): Stopping service:
com.spigo.balloons/.BalloonsService
02-28 15:16:16.187: DEBUG/com.spigo.balloons.GameThread(373):
Cleanup() called
02-28 15:16:16.207: DEBUG/com.spigo.balloons.GameThread(373):
stopTimeUpdate()
02-28 15:16:16.227: DEBUG/com.spigo.balloons.GameThread(373):
GameThread()::called
02-28 15:16:16.537: DEBUG/dalvikvm(373): GC(2) freed 1340 objects /
54416 bytes in 105ms
02-28 15:16:16.707: DEBUG/UpdateService(32755): Processing thread
started
02-28 15:16:16.707: DEBUG/UpdateService(32755): >>>> Activate a backup
alarm in 15 minutes in case of service crash
02-28 15:16:16.847: DEBUG/dalvikvm(373): GC(2) freed 267 objects /
13696 bytes in 99ms
02-28 15:16:17.007: DEBUG/UpdateService(32755): 57 : not configured
yet, so skipping update
02-28 15:16:17.047: DEBUG/UpdateService(32755): 64 : delta since last
forecast update is 2.1122776E7 min / update_period is 360.0 min
02-28 15:16:17.047: DEBUG/UpdateService(32755): 64 : need update
02-28 15:16:17.047: DEBUG/UpdateService(32755): 64 : request calendar
update
02-28 15:16:17.087: DEBUG/UpdateService(32755): 64 : next update at
1267388177000, in 359.0 min
02-28 15:16:17.117: DEBUG/UpdateService(32755): 64 : launch view
update
02-28 15:16:17.147: DEBUG/UpdateService(32755): 64 : providerName =
org.koxx.pure_calendar.Cal4x4AppWidget
02-28 15:16:17.157: DEBUG/WidgetSizeCalulator(32755): orientation = 0
02-28 15:16:17.157: DEBUG/WidgetSizeCalulator(32755): screenWidth =
320
02-28 15:16:17.157: DEBUG/WidgetSizeCalulator(32755): screenHeight =
480
02-28 15:16:17.157: DEBUG/WidgetSizeCalulator(32755): normalWidth =
320
02-28 15:16:17.157: DEBUG/WidgetSizeCalulator(32755): normalHeight =
400
02-28 15:16:17.157: DEBUG/WidgetSizeCalulator(32755): widgetTextWidth
= 275
02-28 15:16:17.167: DEBUG/WidgetSizeCalulator(32755): >> screenRatio =
1.5
02-28 15:16:17.167: DEBUG/WidgetSizeCalulator(32755): widgetWidth =
320
02-28 15:16:17.167: DEBUG/WidgetSizeCalulator(32755): widgetHeight =
400
02-28 15:16:17.167: DEBUG/WidgetSizeCalulator(32755): >>
eventLineBitmapScaleRatio = 1.0
02-28 15:16:17.287: DEBUG/dalvikvm(373): GC(2) freed 21 objects / 1256
bytes in 173ms
02-28 15:16:17.557: DEBUG/dalvikvm(32755): GC(2) freed 900 objects /
57048 bytes in 188ms
02-28 15:16:17.657: INFO/CheckinService(88): From server: Intent
{ action=android.server.checkin.FOTA_CANCEL }
02-28 15:16:17.767: DEBUG/dalvikvm(373): GC(2) freed 652 objects /
39352 bytes in 76ms
02-28 15:16:17.937: DEBUG/dalvikvm(373): GC(2) freed 238 objects /
12600 bytes in 102ms
02-28 15:16:18.237: DEBUG/dalvikvm(373): GC(2) freed 85 objects / 4744
bytes in 181ms
02-28 15:16:18.627: DEBUG/dalvikvm(373): GC(2) freed 78 objects / 4464
bytes in 188ms
02-28 15:16:18.747: INFO/ActivityManager(88): Start proc
com.android.calendar for content provider
com.android.providers.calendar/.CalendarProvider: pid=420 uid=10031
gids={3003}
02-28 15:16:18.857: INFO/jdwp(420): received file descriptor 11 from
ADB
02-28 15:16:18.927: WARN/System.err(420): Can't dispatch DDM chunk
46454154: no handler defined
02-28 15:16:18.927: WARN/System.err(420): Can't dispatch DDM chunk
4d505251: no handler defined
02-28 15:16:19.087: DEBUG/dalvikvm(71): GC(1) freed 267 objects /
10152 bytes in 338ms
02-28 15:16:19.197: DEBUG/dalvikvm(373): GC(2) freed 115 objects /
6968 bytes in 305ms
02-28 15:16:19.207: INFO/ActivityThread(420): Publishing provider
calendar: com.android.providers.calendar.CalendarProvider
02-28 15:16:19.237: INFO/CheckinService(88): From server: Intent
{ action=android.server.checkin.FOTA_CANCEL }
02-28 15:16:19.417: DEBUG/dalvikvm(71): GC(1) freed 47 objects / 2000
bytes in 322ms
02-28 15:16:19.657: DEBUG/dalvikvm(71): GC(1) freed 2 objects / 48
bytes in 225ms

4)
02-28 15:16:19.847: INFO/com.spigo.balloons.Balloons(373):
onCreate()::called - SIS is non-null
02-28 15:16:19.847: DEBUG/com.spigo.balloons.GameThread(373):
setState()::mMode =  2
02-28 15:16:19.847: INFO/com.spigo.balloons.Balloons(373):
onResume()::called - thread state: NEW
02-28 15:16:19.847: INFO/com.spigo.balloons.BalloonsGame(373):
restoreState():called
02-28 15:16:19.857: INFO/com.spigo.balloons.Level(373):
restoreState():called
02-28 15:16:19.907: DEBUG/com.spigo.balloons.GameThread(373):
setState()::mMode =  1
02-28 15:16:19.917: DEBUG/com.spigo.balloons.GameView(373):
startGameThread() called

5)
02-28 15:16:19.917: INFO/com.spigo.balloons.Balloons(373):
onPause()::called
02-28 15:16:19.917: DEBUG/com.spigo.balloons.GameThread(373):
stopTimeUpdate()
02-28 15:16:19.917: INFO/com.spigo.balloons.BalloonsGame(373):
saveState():called
02-28 15:16:19.957: WARN/IInputConnectionWrapper(373): showStatusIcon
on inactive InputConnection
02-28 15:16:19.957: INFO/com.spigo.balloons.BalloonsService(373):
Service destroyed
02-28 15:16:20.007: INFO/com.spigo.balloons.BalloonsService(373):
Service created
02-28 15:16:20.080: WARN/SurfaceFlinger(88): timeout expired
mFreezeDisplay=1, mFreezeCount=0
02-28 15:16:20.197: WARN/WindowManager(88): App freeze timeout
expired.
02-28 15:16:20.197: WARN/WindowManager(88): Force clearing freeze:
AppWindowToken{43a39fc0 token=HistoryRecord{43a28e18
{com.spigo.balloons/com.spigo.balloons.Balloons}}}
02-28 15:16:20.229: WARN/AudioFlinger(72): write blocked for 161 msecs
02-28 15:16:20.287: INFO/ActivityManager(88): Process
com.android.vending (pid 357) has died.
02-28 15:16:20.497: INFO/com.spigo.balloons.BalloonsService(373):
Service bound
02-28 15:16:20.627: INFO/com.spigo.balloons.GameView$1(373):
onServiceConnected()
02-28 15:16:20.647: ERROR/ActivityThread(32755): Failed to find
provider info for calendarEx
02-28 15:16:20.667: ERROR/ActivityThread(32755): Failed to find
provider info for calendarEx
02-28 15:16:20.667: DEBUG/CalendarsEvents(32755): No exchange calendar
found
02-28 15:16:20.837: ERROR/ActivityThread(32755): Failed to find
provider info for calendarEx
02-28 15:16:20.837: DEBUG/CalendarsEvents(32755): No exchange calendar
found
02-28 15:16:20.897: DEBUG/com.spigo.balloons.GameView(373):
surfaceCreated()
02-28 15:16:20.897: DEBUG/com.spigo.balloons.GameView(373):
surfaceChanged()
02-28 15:16:20.897: DEBUG/com.spigo.balloons.GameThread(373):
startTimeUpdate()
02-28 15:16:21.397: VERBOSE/com.spigo.balloons.GameThread$1(373):
mUpdateTimeTask invoked
02-28 15:16:21.397: VERBOSE/com.spigo.balloons.GameThread(373):
updateVideo:called
02-28 15:16:21.947: VERBOSE/com.spigo.balloons.GameThread$1(373):
mUpdateTimeTask invoked
02-28 15:16:21.947: VERBOSE/com.spigo.balloons.GameThread(373):
updateVideo:called
02-28 15:16:22.477: VERBOSE/com.spigo.balloons.GameThread$1(373):
mUpdateTimeTask invoked
02-28 15:16:22.477: VERBOSE/com.spigo.balloons.GameThread(373):
updateVideo:called
02-28 15:16:22.607: DEBUG/dalvikvm(88): GC(1) freed 3300 objects /
212760 bytes in 407ms
02-28 15:16:23.017: VERBOSE/com.spigo.balloons.GameThread$1(373):
mUpdateTimeTask invoked
02-28 15:16:23.017: VERBOSE/com.spigo.balloons.GameThread(373):
updateVideo:called
02-28 15:16:23.547: VERBOSE/com.spigo.balloons.GameThread$1(373):
mUpdateTimeTask invoked
02-28 15:16:23.547: VERBOSE/com.spigo.balloons.GameThread(373):
updateVideo:called
02-28 15:16:23.817: INFO/Resources(32755): Loaded time zone names for
en_US in 2938ms.
02-28 15:16:23.827: DEBUG/CalendarsEvents(32755): firstEvtToEnd =
Forecast for Aalborg, dk (0° | -4°) / Mon Mar 01 00:00:00 GMT+01:00
2010
02-28 15:16:23.927: DEBUG/dalvikvm(32755): GC(2) freed 1153 objects /
91736 bytes in 96ms
02-28 15:16:24.137: VERBOSE/com.spigo.balloons.GameThread$1(373):
mUpdateTimeTask invoked
02-28 15:16:24.137: VERBOSE/com.spigo.balloons.GameThread(373):
updateVideo:called
02-28 15:16:24.397: ERROR/ActivityThread(32755): Failed to find
provider info for calendarEx
02-28 15:16:24.407: DEBUG/CalendarsEvents(32755): No exchange calendar
found
02-28 15:16:24.627: ERROR/ActivityThread(32755): Failed to find
provider info for calendarEx
02-28 15:16:24.627: DEBUG/CalendarsEvents(32755): No exchange calendar
found
02-28 15:16:24.657: VERBOSE/com.spigo.balloons.GameThread$1(373):
mUpdateTimeTask invoked
02-28 15:16:24.657: VERBOSE/com.spigo.balloons.GameThread(373):
updateVideo:called
02-28 15:16:24.797: ERROR/ActivityThread(32755): Failed to find
provider info for calendarEx
02-28 15:16:24.797: DEBUG/CalendarsEvents(32755): No exchange calendar
found
02-28 15:16:24.937: ERROR/ActivityThread(32755): Failed to find
provider info for calendarEx
02-28 15:16:24.937: DEBUG/CalendarsEvents(32755): No exchange calendar
found
02-28 15:16:25.077: ERROR/ActivityThread(32755): Failed to find
provider info for calendarEx
02-28 15:16:25.077: DEBUG/CalendarsEvents(32755): No exchange calendar
found
02-28 15:16:25.207: VERBOSE/com.spigo.balloons.GameThread$1(373):
mUpdateTimeTask invoked
02-28 15:16:25.207: VERBOSE/com.spigo.balloons.GameThread(373):
updateVideo:called
02-28 15:16:25.267: ERROR/ActivityThread(32755): Failed to find
provider info for calendarEx
02-28 15:16:25.267: DEBUG/CalendarsEvents(32755): No exchange calendar
found
02-28 15:16:25.427: ERROR/ActivityThread(32755): Failed to find
provider info for calendarEx
02-28 15:16:25.427: DEBUG/CalendarsEvents(32755): No exchange calendar
found
02-28 15:16:25.577: ERROR/ActivityThread(32755): Failed to find
provider info for calendarEx
02-28 15:16:25.577: DEBUG/CalendarsEvents(32755): No exchange calendar
found
02-28 15:16:25.747: INFO/ActivityManager(88): Process com.newsrob (pid
387) has died.
02-28 15:16:25.757: VERBOSE/com.spigo.balloons.GameThread$1(373):
mUpdateTimeTask invoked
02-28 15:16:25.757: VERBOSE/com.spigo.balloons.GameThread(373):
updateVideo:called

6)
02-28 15:16:25.827: INFO/com.spigo.balloons.Balloons(373):
onResume()::called - thread state: NEW
02-28 15:16:25.827: INFO/com.spigo.balloons.BalloonsGame(373):
restoreState():called
02-28 15:16:25.827: INFO/com.spigo.balloons.Level(373):
restoreState():called
02-28 15:16:25.877: DEBUG/com.spigo.balloons.GameThread(373):
setState()::mMode =  1
02-28 15:16:25.877: DEBUG/com.spigo.balloons.GameView(373):
startGameThread() called
02-28 15:16:25.877: DEBUG/com.spigo.balloons.GameThread(373):
setRunning::called mRun = true
02-28 15:16:25.877: DEBUG/com.spigo.balloons.GameThread(373):
run()::called
02-28 15:16:25.877: DEBUG/com.spigo.balloons.GameThread(373):
update()::called
02-28 15:16:25.877: VERBOSE/com.spigo.balloons.GameThread(373):
updateState()::mMode =  1
02-28 15:16:25.887: VERBOSE/com.spigo.balloons.Level(373):
updateAnimation():called
02-28 15:16:25.887: VERBOSE/com.spigo.balloons.Level(373):
updateSound():called, state = 0
02-28 15:16:25.887: VERBOSE/com.spigo.balloons.GameThread(373):
updateVideo:called
02-28 15:16:25.897: DEBUG/com.spigo.balloons.GameThread(373):
initTick::called
02-28 15:16:25.897: INFO/com.spigo.balloons.BalloonsService$1(373):
Ambient sound task started
02-28 15:16:25.897: INFO/com.spigo.balloons.BalloonsService$1(373):
Ambient sound task started

7)
02-28 15:16:25.897: INFO/com.spigo.balloons.Balloons(373):
onSaveInstanceState()::called
02-28 15:16:25.897: INFO/com.spigo.balloons.BalloonsGame(373):
saveState():called
02-28 15:16:25.927: VERBOSE/com.spigo.balloons.GameThread(373):
run()::unlockCanvasAndPost
02-28 15:16:25.927: DEBUG/com.spigo.balloons.GameThread(373):
update()::called
02-28 15:16:25.947: VERBOSE/com.spigo.balloons.GameThread(373):
update():: lastTickMS=1267366585900 curTickMs=1267366585949
tickDelta=49
02-28 15:16:25.947: VERBOSE/com.spigo.balloons.GameThread(373):
updateState()::mMode =  1
02-28 15:16:25.947: VERBOSE/com.spigo.balloons.Level(373):
updateAnimation():called
02-28 15:16:25.947: VERBOSE/com.spigo.balloons.Level(373):
updateSound():called, state = 1
02-28 15:16:25.947: VERBOSE/com.spigo.balloons.GameThread(373):
updateVideo:called
02-28 15:16:25.987: VERBOSE/com.spigo.balloons.GameThread(373):
run()::unlockCanvasAndPost
02-28 15:16:25.987: VERBOSE/com.spigo.balloons.GameThread(373):
run()::Trying to sleep..
02-28 15:16:25.987: DEBUG/com.spigo.balloons.GameThread(373):
run()::Going to sleep..
02-28 15:16:25.987: ERROR/ActivityThread(32755): Failed to find
provider info for calendarEx
02-28 15:16:25.987: DEBUG/CalendarsEvents(32755): No exchange calendar
found
02-28 15:16:26.147: DEBUG/dalvikvm(373): GC(1) freed 6639 objects /
244232 bytes in 158ms
02-28 15:16:26.157: INFO/com.spigo.balloons.Balloons(373):
onPause()::called
02-28 15:16:26.167: DEBUG/com.spigo.balloons.GameThread(373):
stopTimeUpdate()
02-28 15:16:26.167: INFO/com.spigo.balloons.BalloonsService$1(373):
Ambient sound task stopped
02-28 15:16:26.317: DEBUG/UpdateService(32755): 64 : updateAppWidget
(push update to remote view)

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to