mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2026-11-02 11:37:37 +00:00
バックスタックに積まずにナビゲーションするメソッドを追加
This commit is contained in:
1 file changed
+14
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user