From 2a37b00a825e5692857e0b6fc10686050fb33f7f Mon Sep 17 00:00:00 2001 From: Carmen Date: Thu, 22 Nov 2018 17:07:58 -0500 Subject: [PATCH] Fixed issue with recent bathrooms navigation item. --- .../main/java/org/refugerestrooms/views/MainActivity.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/org/refugerestrooms/views/MainActivity.java b/app/src/main/java/org/refugerestrooms/views/MainActivity.java index a2c6311..2077c47 100644 --- a/app/src/main/java/org/refugerestrooms/views/MainActivity.java +++ b/app/src/main/java/org/refugerestrooms/views/MainActivity.java @@ -1445,6 +1445,7 @@ public boolean onNavigationItemSelected(MenuItem item) { mFab.show(); bottomSheet.setVisibility(View.VISIBLE); } else if (id == R.id.nav_bathrooms) { + Log.d("RefugeRestrooms", "Nav bathrooms"); title = getString(R.string.saved_bathrooms); List bathroomsList = loadSavedBathrooms(); DatabaseEntityConverter dataEntityConv = new DatabaseEntityConverter(); @@ -1454,6 +1455,7 @@ public boolean onNavigationItemSelected(MenuItem item) { bottomSheet.setVisibility(View.VISIBLE); } else if (id == R.id.nav_add) { title = getString(R.string.add_title_section); + fragment = addBathroomFragment; fragmentTitle = "addBathroom"; mFab.show(); bottomSheet.setVisibility(View.INVISIBLE); @@ -1471,12 +1473,6 @@ public boolean onNavigationItemSelected(MenuItem item) { .addToBackStack(fragmentTitle) .commit(); setToolbarTitle(title); - } else { - fragmentManager.beginTransaction() - .replace(R.id.container, addBathroomFragment) - .addToBackStack(fragmentTitle) - .commit(); - setToolbarTitle(title); } DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);