/*
- * Copyright © 2019 Damyan Ivanov.
+ * Copyright © 2020 Damyan Ivanov.
* This file is part of MoLe.
* MoLe is free software: you can distribute it and/or modify it
* under the term of the GNU General Public License as published by
import androidx.appcompat.widget.Toolbar;
import androidx.lifecycle.ViewModelProvider;
import androidx.navigation.NavController;
-import androidx.navigation.Navigation;
+import androidx.navigation.fragment.NavHostFragment;
import net.ktnx.mobileledger.BuildConfig;
import net.ktnx.mobileledger.R;
Data.observeProfile(this,
mobileLedgerProfile -> toolbar.setSubtitle(mobileLedgerProfile.getName()));
- navController = Navigation.findNavController(this, R.id.new_transaction_nav);
+ NavHostFragment navHostFragment = (NavHostFragment) Objects.requireNonNull(
+ getSupportFragmentManager().findFragmentById(R.id.new_transaction_nav));
+ navController = navHostFragment.getNavController();
Objects.requireNonNull(getSupportActionBar())
.setDisplayHomeAsUpEnabled(true);
</com.google.android.material.appbar.AppBarLayout>
- <fragment
+ <androidx.fragment.app.FragmentContainerView
android:id="@+id/new_transaction_nav"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="0dp"
android:layout_height="0dp"
+ app:defaultNavHost="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"