From 30a7b42425a0c508895dc326529adc711c0c2016 Mon Sep 17 00:00:00 2001 From: Frosty-J <60154347+Frosty-J@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:02:24 +0100 Subject: [PATCH] Don't crash the app if not an activity --- .../com/badlogic/gdx/tests/android/FragmentTestStarter.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/gdx-tests-android/src/com/badlogic/gdx/tests/android/FragmentTestStarter.java b/tests/gdx-tests-android/src/com/badlogic/gdx/tests/android/FragmentTestStarter.java index eb22f2dfa5b..18cbe872056 100644 --- a/tests/gdx-tests-android/src/com/badlogic/gdx/tests/android/FragmentTestStarter.java +++ b/tests/gdx-tests-android/src/com/badlogic/gdx/tests/android/FragmentTestStarter.java @@ -21,6 +21,7 @@ import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; import com.badlogic.gdx.backends.android.AndroidFragmentApplication; +import com.badlogic.gdx.tests.BackTest; import com.badlogic.gdx.tests.utils.GdxTest; import com.badlogic.gdx.tests.utils.GdxTests; @@ -33,6 +34,8 @@ public class FragmentTestStarter extends FragmentActivity implements AndroidFrag protected void onCreate (Bundle savedInstanceState) { super.onCreate(savedInstanceState); GdxTests.tests.add(MatrixTest.class); + if (!GdxTests.tests.contains(MatrixTest.class)) GdxTests.tests.add(MatrixTest.class); + if (!GdxTests.tests.contains(BackTest.class)) GdxTests.tests.add(BackTest.class); LinearLayout layout = new LinearLayout(this); layout.setOrientation(LinearLayout.HORIZONTAL);