android-jetpack-navigation

BottomNavigation Menu with Jetpack Navigation does not navigate

旧巷老猫 提交于 2021-02-11 17:36:06
问题 I have a strange problem regarding a BottomNavigationBar which I could not solve altough having spent a huge amount of time into it. When I use it in the 'recommended' way (from many tutorials) it just does not navigate. So what do I mean by 'recommended' way: I have a single acticity with a navHostFragment called 'MainActivity'. This main activity has a XML layout file in which I put the BottomNavigationBar. The BottomNavigationBar also has a XML layout file. Now I have a Fragment called 'FR

How to manage bottomNavigation from fragment?

依然范特西╮ 提交于 2021-02-11 14:47:39
问题 I'm trying to set navController to bottomNavigation, but it's requires activity, the problem is my borromNavigation hosted in fragment, so i don't have activity instance. I've tried bottom_nav_view.setupWithNavController(findNavController()) and: val host = Navigation.findNavController(this.activity!!.parent, R.id.my_nav_host_fragment) bottom_nav_view.setupWithNavController(host) home_fragment.xml: <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns

how to open multiple instances of a fragment in navigation component?

两盒软妹~` 提交于 2021-01-28 08:01:55
问题 I working on a social media App. when user click on a post, a new fragment open and some related post showing under it. if user click on a related post, new instance of that fragment must open and show clicked post and related posts under it. this page also have this behavior. each page must add to back stack. for using navigation component, in this case destination fragment is current fragment with different argument. can do this in navigation component? 回答1: we can open multiple instace of

Jetpack Navigation handling deeplinks manually in onNewIntent

蹲街弑〆低调 提交于 2021-01-24 08:15:19
问题 I'm using Jetpack Navigation. I need to handle deeplinks manually because: 1) Implicit deeplinks are not working properly with android:launchMode="singleTask" Deeplink isn't correctly redirect if the app is already opened 2) I'm passing in my bundles not only simple types but also Parcelables, so I won't have the possibility to pass arguments I've done proof of concept that is using explicit deeplinkins in onNewintent of my Activity override fun onNewIntent(intent: Intent?) { super

Jetpack Navigation handling deeplinks manually in onNewIntent

最后都变了- 提交于 2021-01-24 08:13:36
问题 I'm using Jetpack Navigation. I need to handle deeplinks manually because: 1) Implicit deeplinks are not working properly with android:launchMode="singleTask" Deeplink isn't correctly redirect if the app is already opened 2) I'm passing in my bundles not only simple types but also Parcelables, so I won't have the possibility to pass arguments I've done proof of concept that is using explicit deeplinkins in onNewintent of my Activity override fun onNewIntent(intent: Intent?) { super

ViewPager2 crash

断了今生、忘了曾经 提交于 2021-01-03 05:59:39
问题 i am using Advance Navigation Component with BottomNavigationView, In One tab i have viewPager2 first clicked on tab is working fine but second time come on that tab application keep crashing. Below is crashlog if anyone can help thanks. java.lang.IllegalArgumentException at androidx.core.util.Preconditions.checkArgument(Preconditions.java:36) at androidx.viewpager2.adapter.FragmentStateAdapter.onAttachedToRecyclerView(FragmentStateAdapter.java:140) at androidx.recyclerview.widget

ViewPager2 crash

独自空忆成欢 提交于 2021-01-03 05:58:34
问题 i am using Advance Navigation Component with BottomNavigationView, In One tab i have viewPager2 first clicked on tab is working fine but second time come on that tab application keep crashing. Below is crashlog if anyone can help thanks. java.lang.IllegalArgumentException at androidx.core.util.Preconditions.checkArgument(Preconditions.java:36) at androidx.viewpager2.adapter.FragmentStateAdapter.onAttachedToRecyclerView(FragmentStateAdapter.java:140) at androidx.recyclerview.widget

ViewPager2 crash

删除回忆录丶 提交于 2021-01-03 05:58:00
问题 i am using Advance Navigation Component with BottomNavigationView, In One tab i have viewPager2 first clicked on tab is working fine but second time come on that tab application keep crashing. Below is crashlog if anyone can help thanks. java.lang.IllegalArgumentException at androidx.core.util.Preconditions.checkArgument(Preconditions.java:36) at androidx.viewpager2.adapter.FragmentStateAdapter.onAttachedToRecyclerView(FragmentStateAdapter.java:140) at androidx.recyclerview.widget