【发布时间】:2020-11-09 09:57:46
【问题描述】:
在堆栈溢出的以下链接中提出的问题中,我正在关注具有多个顶级目的地的导航图的实现:Navigation graph with multiple top level destinations
根据第二个答案,首先创建了一组顶级目的地
val topLevelDestinations = setOf(R.id.garden_fragment,
R.id.plant_list_fragment)
appBarConfiguration = AppBarConfiguration.Builder(topLevelDestinations)
.setDrawerLayout(drawerLayout)
.build()
我遇到的问题是代码在 Kotlin 中,我了解如何在 java 中实现以下部分代码
appBarConfiguration = AppBarConfiguration.Builder(topLevelDestinations)
.setDrawerLayout(drawerLayout)
.build()
问题是我不知道如何在java中实现第一部分代码,这个
val topLevelDestinations = setOf(R.id.garden_fragment,
R.id.plant_list_fragment)
【问题讨论】:
标签: navigation uinavigationcontroller navigation-drawer drawerlayout appbar