diff --git a/app/src/main/java/one/nem/lacerta/MainActivity.java b/app/src/main/java/one/nem/lacerta/MainActivity.java index 0ef81860..e97093e1 100644 --- a/app/src/main/java/one/nem/lacerta/MainActivity.java +++ b/app/src/main/java/one/nem/lacerta/MainActivity.java @@ -96,4 +96,18 @@ public class MainActivity extends AppCompatActivity implements FragmentNavigatio .addToBackStack(null) .commit(); } + + @Override + public void navigateToFragment(Fragment fragment, boolean addToBackStack) { + if (addToBackStack) { + getSupportFragmentManager().beginTransaction() + .replace(R.id.nav_host_fragment, fragment) + .addToBackStack(null) + .commit(); + } else { + getSupportFragmentManager().beginTransaction() + .replace(R.id.nav_host_fragment, fragment) + .commit(); + } + } }