1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-22 22:13:35 +02:00

Fix crash on haptic feedback on Android

This commit is contained in:
Ivan Savenko 2023-08-06 14:11:14 +03:00
parent 702f57d5cc
commit 48f130cd76

View File

@ -146,7 +146,7 @@ public class NativeMethods
public static void hapticFeedback()
{
final Context ctx = SDL.getContext();
if (Build.VERSION.SDK_INT >= 26) {
if (Build.VERSION.SDK_INT >= 29) {
((Vibrator) ctx.getSystemService(ctx.VIBRATOR_SERVICE)).vibrate(VibrationEffect.createPredefined(VibrationEffect.EFFECT_TICK));
} else {
((Vibrator) ctx.getSystemService(ctx.VIBRATOR_SERVICE)).vibrate(30);