I have a rather complicated Android app where I process rotation myself through onConfigurationChanged, and not restart activity. After using the device or emulator for some time (many turns), I begin to see that the application does not work out correctly with interruptions (it preserves the width of the portrait in landscape mode)
I have added trace logging instructions to all the "onAction" events in the activity, and I see two different threads:
Correctly:
- onConfigurationChanged
- onMeasure (with old width)
- Onlayout
- onMeasure (with new width)
- onSizeChanged
- Onlayout
- Ondraw
When the layout is wrong, I see this stream
Wrong:
- onMeasure (with new width)
- onSizeChanged
- Onlayout
- Ondraw
- onConfigurationChanged
- onMeasure (with new width)
- Onlayout
- Ondraw
, , : 3 , :
- MessageType 1003 → mWinFrame
- MessageType 1000 → / ( mWinFrame)
- MessageType 118 → , onConfigurationChanged.
, 118, 1003, 1000. , 1003, 1000, 118, , onConfigurationChanged.
, , , , , , / onPreDraw.
:
1) , onConfigurationChanged , , ?
2) ? , , / " ".