fixed navbar update on backbutton clicked

This commit is contained in:
Bart
2021-01-14 10:23:20 +01:00
parent 391c0729e4
commit 9dbbb80594
3 changed files with 26 additions and 3 deletions

View File

@@ -65,9 +65,10 @@ public class SettingsFragment extends Fragment {
ImageView backButton = view.findViewById(R.id.settings_back_button);
backButton.setOnClickListener(v -> {
HomeFragment homeFragment = new HomeFragment();
if (getActivity() != null)
if (getActivity() != null) {
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, homeFragment).addToBackStack(null).commit();
});
refreshable.refreshAndNavigateTo(R.id.map_view);
}});
SharedPreferences sharedPreferences = getContext().getSharedPreferences("Settings", Context.MODE_PRIVATE);