Here's my case,
- my app ran an internal event loop, which processed some custom events
- I invoked it at OnIdle() to handle events in another Win32 implementation, so that it could get triggered if there's no more system events to process, and try to handle them if there's any pending internal events, then exit loop and waited for another idle coming. This was how it's supposed to work.
As for Android, I'd like to do it in same way, but I didn't figure out how to do such idle pro开发者_运维问答cessing. How to get it?
Thanks.
Create a Handler in your activity's onCreate
method. Write your idle processing to do a chunk of work and then call the handler's post
or postDelayed
method passing a Runnable
to do the next chunk. The next chunk won't execute until after any pending events are processed.
精彩评论