From cff730b60a5203926063fe7a6be5c8954a0ab1f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 11 Jul 2024 15:47:24 +0900 Subject: [PATCH] =?UTF-8?q?=E7=B0=A1=E7=B4=A0=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/example/childguard/TestService.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/example/childguard/TestService.java b/app/src/main/java/com/example/childguard/TestService.java index 6b4c307..25d9e24 100644 --- a/app/src/main/java/com/example/childguard/TestService.java +++ b/app/src/main/java/com/example/childguard/TestService.java @@ -270,12 +270,9 @@ public class TestService extends Service { boolean isInCar = pref.getBoolean("isInCarPref", false); if (BluetoothDevice.ACTION_ACL_DISCONNECTED.equals(action) && !isInCar) { // bluetoothが切断されたときに乗車状態のとき - notificationRunnable = new Runnable() { - @Override - public void run() { - // 5分経過した時点でも車に乗っていない場合 - Notification(context, BLUETOOTH_NOTIFICATION); - } + notificationRunnable = () -> { + // 5分経過した時点でも車に乗っていない場合 + Notification(context, BLUETOOTH_NOTIFICATION); }; handler.postDelayed(notificationRunnable, 5 * 60 * 1000); // 5分をミリ秒に変換