From d5df291c81d2ccf58e176fe7b21ee018124a45fa Mon Sep 17 00:00:00 2001 From: r-ca Date: Mon, 22 Jan 2024 23:47:46 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=90=E3=83=83=E3=82=AF=E3=82=B9=E3=82=BF?= =?UTF-8?q?=E3=83=83=E3=82=AF=E3=81=AB=E7=A9=8D=E3=81=BE=E3=81=9A=E3=81=AB?= =?UTF-8?q?=E3=83=8A=E3=83=93=E3=82=B2=E3=83=BC=E3=82=B7=E3=83=A7=E3=83=B3?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=83=A1=E3=82=BD=E3=83=83=E3=83=89=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/one/nem/lacerta/MainActivity.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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(); + } + } }