Hello Phil,
What I still don't understand is: "... so far cannot distinguish between 1 screen being closed or all screens being closed as UpdateViewState() gets called for each screen during the while loop."
If you close the top screen only, then the UpdateViewState() is called for this screen and the next below one. The method parameter aState determines the new state of the affected GUI component:
- The screen you end the modal state: UpdateViewState() is called and you can see in the parameter aState that it is not Modal anymore. This screen also looses the Focused state.
- The next screen in the modal stacking order: its UpdateViewState() is called and you can see in the parameter aState that it has now the Focused state.
Accordingly, all actually existing modal screens have the state Modal but only the top-most modal screen (the screen the user actually interacts with) has the state Focused. You could thus start the timer as soon as the component enters the Focused state and stop it again when it leaves this state.
Please see also : Common component states.
Does it help you further?
Best regards
Paul Banach