From 1231748f76d72a8171c29395e86f2049b7149dbc 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:51 +0900 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E8=A6=81=E3=81=AA=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E3=82=B9=E3=82=BF=E3=83=B3=E3=82=B9=E3=82=92=E4=BD=9C=E6=88=90?= =?UTF-8?q?=E3=81=97=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/com/example/childguard/TestService.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/java/com/example/childguard/TestService.java b/app/src/main/java/com/example/childguard/TestService.java index 25d9e24..1a66e62 100644 --- a/app/src/main/java/com/example/childguard/TestService.java +++ b/app/src/main/java/com/example/childguard/TestService.java @@ -265,9 +265,8 @@ public class TestService extends Service { } // ----------------------------------------------------- - SharedPreferences pref = getSharedPreferences("Bluetooth_situation", MODE_PRIVATE); String action = intent.getAction(); // may need to chain this to a recognizing function - boolean isInCar = pref.getBoolean("isInCarPref", false); + boolean isInCar = getSharedPreferences("Bluetooth_situation", MODE_PRIVATE).getBoolean("isInCarPref", false); if (BluetoothDevice.ACTION_ACL_DISCONNECTED.equals(action) && !isInCar) { // bluetoothが切断されたときに乗車状態のとき notificationRunnable = () -> {