onResumeでSharedPreferenceから読み取ってUIを更新するように
This commit is contained in:
parent
dfc9440ab5
commit
d817dfaf58
|
@ -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() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user