Created
April 14, 2021 03:20
-
-
Save ajailani4/30751561c9ace6680ea10787eccbefe7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@AndroidEntryPoint | |
class MainActivity : AppCompatActivity() { | |
private lateinit var binding: ActivityMainBinding | |
private lateinit var navController: NavController | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
binding = ActivityMainBinding.inflate(layoutInflater) | |
setContentView(binding.root) | |
// NavHost Fragment as Fragment Container | |
val navHostFragment = | |
supportFragmentManager.findFragmentById(R.id.navHostFragment) as NavHostFragment | |
// NavController is for controlling the navigation | |
navController = navHostFragment.findNavController() | |
binding.bottomNav.setupWithNavController(navController) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment