[Interest] Android: can QCoreApplication::exec() be terminated unexpectedly?

Jason H jhihn at gmx.com
Sun Dec 1 05:52:04 CET 2019


The Qt event loop is tied to your Activity. An Android app can have several activities (which are UIs) and services. Android can kill your app at anytime, you're supposed to stave your UI state inva bundle and restore it when it's needed again, as per lifecycle events. It's annoying.

> Sent: Saturday, November 30, 2019 at 1:36 PM
> From: "Alexander Dyagilev" <alervdvcw at gmail.com>
> To: "interestqt-project. org" <interest at qt-project.org>
> Subject: [Interest] Android: can QCoreApplication::exec() be terminated unexpectedly?
>
> Hello,
>
> It seems that my app "suffers" from unexpected terminating of
> QCoreApplication::exec() event loop processing.
>
> I was always thinking that QCoreApplication::exec() terminates only if
> one calls QCoreApplication::quit().
>
> But under Android it seems that either QCoreApplication::quit() is
> somehow called by Qt itself (i.e. not by my code), or it's terminated
> due to an unknown (for me) reason.
>
> I use QApplication for main activity process and QAndroidService for
> service process. Don't know exactly inside what process this occurs.
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> https://lists.qt-project.org/listinfo/interest
>


More information about the Interest mailing list