lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Mon, Aug 12, 2019 at 3:17 PM Andreas Falkenhahn <> wrote:

> Since Android doesn't have the concept of modal loops, lua_pcall() needs to return control to the UI thread immediately even though the user hasn't closed the message box created by showMessageBox() yet. So when entering my showMessageBox() implementation I'd somehow need to tell lua_pcall() to pause its execution and resume it later when the user has closed the message box. Is that possible somehow?

I doubt this problem is really about Lua. You real issue is that whatever you do on the UI thread should not block it. If you "pause" it, that will still block it. So whatever you call on the UI thread should readily return - it cannot enter showMessageBox() and just stay there.

If I knew more about Android, I'd say you might also consider running the message/event loop within your implementation, thus alleviating the need to return from it, but, again, I am really just groping in the dark here.