通过片段BackPressed到先前的片段导航组件

时间:2019-10-12 12:08:14

标签: android-architecture-navigation onbackpressed android-navigationview child-fragment android-navigation-graph

我想问: 从childFragment到前一个Fragment,在使用Navigation Component,androidx,Kotlin时允许BackPressed()。

我试图编写的代码是浏览片段和bottomNavigation。 在一个片段中,我通过customViewPager使用子片段来禁用滑动。 回到childFragment时,我希望它是上一个Fragment,而不是在父/主机上。

有可能吗? BackPressed()方法是否适用于片段内?

0 个答案:

没有答案