From 1c78e9280390d2afa7607e326f021d89f1e4bb33 Mon Sep 17 00:00:00 2001 From: soywiz Date: Wed, 12 Jul 2023 21:00:54 +0200 Subject: [PATCH] Android: Fixes crash with vfsInitWithAndroidContextOnce --- korgw/src/androidMain/kotlin/korlibs/render/KorgwActivity.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/korgw/src/androidMain/kotlin/korlibs/render/KorgwActivity.kt b/korgw/src/androidMain/kotlin/korlibs/render/KorgwActivity.kt index 444fc91994..39a5b66d81 100644 --- a/korgw/src/androidMain/kotlin/korlibs/render/KorgwActivity.kt +++ b/korgw/src/androidMain/kotlin/korlibs/render/KorgwActivity.kt @@ -40,7 +40,6 @@ abstract class KorgwActivity( private var defaultUiVisibility = -1 init { - vfsInitWithAndroidContextOnce(this) activityWithResult.activity = this gameWindow.onContinuousRenderModeUpdated = { mGLView?.continuousRenderMode = it @@ -52,6 +51,8 @@ abstract class KorgwActivity( public override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + vfsInitWithAndroidContextOnce(this) + intent.extras?.get("sleepBeforeStart")?.toString()?.toLongOrNull()?.let { Thread.sleep(it) println("Slept $it milliseconds")