From d817dfaf58e3e9dd83ae460a4b4a390611ed0ace 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 14:01:16 +0900 Subject: [PATCH] =?UTF-8?q?onResume=E3=81=A7SharedPreference=E3=81=8B?= =?UTF-8?q?=E3=82=89=E8=AA=AD=E3=81=BF=E5=8F=96=E3=81=A3=E3=81=A6UI?= =?UTF-8?q?=E3=82=92=E6=9B=B4=E6=96=B0=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=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/HomeFragment.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/com/example/childguard/HomeFragment.java b/app/src/main/java/com/example/childguard/HomeFragment.java index 9058f94..5f462f3 100644 --- a/app/src/main/java/com/example/childguard/HomeFragment.java +++ b/app/src/main/java/com/example/childguard/HomeFragment.java @@ -80,6 +80,12 @@ public class HomeFragment extends Fragment implements OnEventListener { super.onResume(); Log.d("HomeFragment", "onResume: called"); this.updateUiState(getIsInCarLocal()); + this.updateBluetoothSituation(isBluetoothConnected()); + } + + private boolean isBluetoothConnected() { + SharedPreferences pref = requireActivity().getSharedPreferences("Bluetooth_situation", requireActivity().MODE_PRIVATE); + return pref.getBoolean("status", false); } private boolean getIsInCarLocal() {