I am processing UI instructions on a virtual machine (V8 actually) on Android in the main UI thread. This works fine. However, now I'm adding a JavaScript debugger into the mix (Stetho in my case). I can pause the UI thread when a breakpoint is hit, and even step through instructions. However, when an instruction changes the UI, the UI is not immediately updated. Instead, the view is invalidated and only when the main event loop continues processing will the updates render.
So my question is, can I force a redraw of the entire device from the UI thread without returning to the main loop? If I return to the main loop then I will blow my entire call stack, and pausing during debugging will no longer work.
I tried to get the main Looper, and I can even call Loop() on it (ideally to start processing the events), but then this will become the main loop (and you cannot quit the main looper). If anyone has any thoughts on how to simulate the main event loop, that would be greatly appreciated.