diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java index f5309869d5..50cd19069b 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java @@ -309,7 +309,6 @@ public final class EmulationActivity extends AppCompatActivity protected void onStop() { super.onStop(); - Rumble.clear(); } @Override diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/Rumble.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/Rumble.java index 7acc7c4a94..c2f7ac4d59 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/Rumble.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/Rumble.java @@ -18,10 +18,12 @@ import java.util.HashMap; public class Rumble { private static Vibrator phoneVibrator; - private static SparseArray emuVibrators; + private static final SparseArray emuVibrators = new SparseArray<>(); public static void initRumble(EmulationActivity activity) { + clear(); + if (activity.deviceHasTouchScreen() && PreferenceManager.getDefaultSharedPreferences(activity) .getBoolean("phoneRumble", true)) @@ -29,7 +31,6 @@ public class Rumble setPhoneVibrator(true, activity); } - emuVibrators = new SparseArray<>(); for (int i = 0; i < 8; i++) { StringSetting deviceName = @@ -65,7 +66,7 @@ public class Rumble } } - public static void clear() + private static void clear() { phoneVibrator = null; emuVibrators.clear();