Skip to content

How to use this with NavController #108

@Zunnorain

Description

@Zunnorain

I am trying to add this to NavControllers in order to replace fragments.
Another way is to use fragment transactions to replace fragments like this tutorial:
https://www.youtube.com/watch?v=fmrYeiw-0EQ
But that's not what i wanted. Kindly provide some way to use NavController

Eg:

val navHostFragment = supportFragmentManager.findFragmentById(R.id.nav_host_fragment) as NavHostFragment
navController = navHostFragment.navController
setupWithNavController(binding.bottomNav, navController)<==== Error here

Currently gives error at setupWithNavController(binding.bottomNav, navController)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions