From 4a372b1b19a805e5e96946fc2bf1e852e6538bd0 Mon Sep 17 00:00:00 2001 From: saugat pudasaini Date: Sun, 8 Dec 2024 00:27:27 +0100 Subject: [PATCH] solved while navigation and creating arview second time getview returing null and crash the app --- .../difrancescogianmarco/arcore_flutter_plugin/ArCoreView.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/android/src/main/kotlin/com/difrancescogianmarco/arcore_flutter_plugin/ArCoreView.kt b/android/src/main/kotlin/com/difrancescogianmarco/arcore_flutter_plugin/ArCoreView.kt index f1a3e05b..c035ed0d 100644 --- a/android/src/main/kotlin/com/difrancescogianmarco/arcore_flutter_plugin/ArCoreView.kt +++ b/android/src/main/kotlin/com/difrancescogianmarco/arcore_flutter_plugin/ArCoreView.kt @@ -508,8 +508,9 @@ class ArCoreView(val activity: Activity, context: Context, messenger: BinaryMess result.success(null) } + // return view and create new view on null override fun getView(): View { - return arSceneView as View + return arSceneView ?: ArSceneView(activity) } override fun dispose() {