Open gmalija opened 3 years ago
I've got an example here showing the behaviour you're looking for using. I use Fragments only instead of the Activity, and the Bottom Navigation View is hosted in it's own Fragment so you don't need to bother hiding and showing the BottomNavigationView on your Splash screen or anywhere else because you can just navigate to different Fragments instead
same here, Does anyone have a solution for this case?
I am also facing the same issue .. is there any solution? Without Splash everything works well.
I'm implementing this bottom navigation pattern but with a splash fragment.
My issue is when I navigate throw different fragments with bottom menu and I press to go back, I don't go back to the home fragment, instead of this, I return to the previous fragment.
For example, I have fragments A-B-C:
Now I'm on fragment A and I press to go to B. Then I press to go to C (from B). Then I press to go back. The result is I'm getting back to B, not to fragment A (what I really want!). (If I set in the navigation graph app:startDestination -> fragment A - instead of login fragment - everything goes well).
Here is my graph:
<navigation xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/main_navigation" app:startDestination="@id/splashFragment">
And here my MainActivity:
class MainActivity : AppCompatActivity() {
private lateinit var appBarConfiguration: AppBarConfiguration private lateinit var navController: NavController
}
Thanks!