Android Question StateManager Class - DoEvents


Licensed User
Longtime User
Replace DoEvents with sleep(0) ?
I'm not so sure.

That DoEvents is inside of innerRestoreState routine, which is a recursive routine (it calls itself).

It is also called by a public method, RestoreState, and we cannot know how the user-developer will call this routine (he could call it at bottom of a "calling chain")


1) I think that you should never replace DoEvents with Sleep(0) if it is inside a recursive routine; am I wrong?

2) what happen if it is called by a public method... [second situation described above]?
Last edited:
Upvote 0


Active Member
Licensed User
Longtime User

I've replaced DoEvents with Sleep (with Replace all ....), and get problems.
(I do not remember exactly what, but I think the app has crashed),
so I've been replacing the Sleep(0) back to DoEvents.
Upvote 0