@@ -112,16 +112,16 @@ Engine::~Engine() {
112112}
113113
114114void Engine::InitUI () {
115+ // The window is being shown, get it ready.
116+ jui_helper::JUIWindow::Init (app_->activity , JUIHELPER_CLASS_NAME);
117+
115118 // Show toast with app label
116119 ndk_helper::JNIHelper::GetInstance ()->RunOnUiThread ([]() {
117120 jui_helper::JUIToast toast (
118121 ndk_helper::JNIHelper::GetInstance ()->GetAppLabel ());
119122 toast.Show ();
120123 });
121124
122- // The window is being shown, get it ready.
123- jui_helper::JUIWindow::Init (app_->activity , JUIHELPER_CLASS_NAME);
124-
125125 //
126126 // Buttons
127127 //
@@ -472,6 +472,9 @@ void Engine::UpdateFPS(float fps) {
472472}
473473
474474void Engine::OnAuthActionStarted (gpg::AuthOperation op) {
475+ if (!initialized_resources_) {
476+ return ;
477+ }
475478 ndk_helper::JNIHelper::GetInstance ()->RunOnUiThread ([this , op]() {
476479 if (status_text_) {
477480 if (op == gpg::AuthOperation::SIGN_IN) {
@@ -485,6 +488,10 @@ void Engine::OnAuthActionStarted(gpg::AuthOperation op) {
485488
486489void Engine::OnAuthActionFinished (gpg::AuthOperation op,
487490 gpg::AuthStatus status) {
491+ if (!initialized_resources_) {
492+ return ;
493+ }
494+
488495 ndk_helper::JNIHelper::GetInstance ()->RunOnUiThread ([this , status]() {
489496 if (status == gpg::AuthStatus::VALID) {
490497 jui_helper::JUIToast toast (" Signed In." );
0 commit comments