HomeFragment以外でBluetoothの状態が変化するとクラッシュする不具合を修正 #25

Merged
asura146 merged 2 commits from improve/fix_bt into main 2024-07-11 06:29:51 +00:00
Showing only changes of commit d817dfaf58 - Show all commits

View File

@ -80,6 +80,12 @@ public class HomeFragment extends Fragment implements OnEventListener {
super.onResume(); super.onResume();
Log.d("HomeFragment", "onResume: called"); Log.d("HomeFragment", "onResume: called");
this.updateUiState(getIsInCarLocal()); 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() { private boolean getIsInCarLocal() {