android-navigation

can I send nullable data type as argument using safeargs ? if not what should I do?

 ̄綄美尐妖づ 提交于 2020-04-30 06:25:27
问题 say I have 2 fragments. Login and Home. I set Home fragment as a global destination that has userData as arguments if the user is not logged in yet, then it will start from login fragment. after login and get userData from server then it will navigate to Home and pass userData using this code val home = AuthenticationFragmentDirections.actionGlobalHomeFragment(userData) Navigation.findNavController(view).navigate(home, navOptions) but the problem is when the user already login and open the

Preserve view with data of recyclerview list in NavController Fragments

旧巷老猫 提交于 2020-04-18 05:30:48
问题 What approach should be taken to preserve (data & view rendering) of recyclerview list in 2 tabs present within a fragment, which is part of androidx.navigation NavController ? Activity --> Fragment A --> Fragment B (with 2 tabs) --> Fragment C (and back till activity) Each tab of Fragment B has accordion type view (multiple active), made from 1 ParentRecycler view & ChildRecycler view (number of parent recycler view times) (The recycler view list are not bound to change on previous next

Preserve view with data of recyclerview list in NavController Fragments

▼魔方 西西 提交于 2020-04-18 05:29:27
问题 What approach should be taken to preserve (data & view rendering) of recyclerview list in 2 tabs present within a fragment, which is part of androidx.navigation NavController ? Activity --> Fragment A --> Fragment B (with 2 tabs) --> Fragment C (and back till activity) Each tab of Fragment B has accordion type view (multiple active), made from 1 ParentRecycler view & ChildRecycler view (number of parent recycler view times) (The recycler view list are not bound to change on previous next

GnssStatus.CallBack onSatelliteStatusChanged() not working

此生再无相见时 提交于 2020-04-10 03:55:09
问题 I am developing an application that I want to learn about the count of gps satellites. I am using the "onSatelliteStatusChanged" method for this, but it does not work. The piece of code that I use below that you see. Code if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { gnssStatusCallBack = new GnssStatus.Callback() { @Override public void onSatelliteStatusChanged(GnssStatus status) { satelliteCount = status.getSatelliteCount(); } }; locManager.registerGnssStatusCallback

still have error no current navigation node even after using navigation 2.2.1

痞子三分冷 提交于 2020-03-25 13:46:02
问题 I have tried to read this but it doesn't solve my issue so I navigate to next destination using this code val nextDirection = CreateEventNameFragmentDirections.actionToCreateEventType(userKM, newEvent) findNavController().navigate(nextDirection) but it crash after I rotate the device with error java.lang.IllegalStateException: no current navigation node i update the gradle using this implementation 'android.arch.navigation:navigation-fragment-ktx:2.2.1' implementation 'android.arch.navigation

still have error no current navigation node even after using navigation 2.2.1

回眸只為那壹抹淺笑 提交于 2020-03-25 13:45:33
问题 I have tried to read this but it doesn't solve my issue so I navigate to next destination using this code val nextDirection = CreateEventNameFragmentDirections.actionToCreateEventType(userKM, newEvent) findNavController().navigate(nextDirection) but it crash after I rotate the device with error java.lang.IllegalStateException: no current navigation node i update the gradle using this implementation 'android.arch.navigation:navigation-fragment-ktx:2.2.1' implementation 'android.arch.navigation

still have error no current navigation node even after using navigation 2.2.1

两盒软妹~` 提交于 2020-03-25 13:45:02
问题 I have tried to read this but it doesn't solve my issue so I navigate to next destination using this code val nextDirection = CreateEventNameFragmentDirections.actionToCreateEventType(userKM, newEvent) findNavController().navigate(nextDirection) but it crash after I rotate the device with error java.lang.IllegalStateException: no current navigation node i update the gradle using this implementation 'android.arch.navigation:navigation-fragment-ktx:2.2.1' implementation 'android.arch.navigation

Android NavigationUI startDestination class (not ID) programmatically

懵懂的女人 提交于 2020-03-04 18:57:21
问题 I need to set the start destination of a navigation graph programmatically depending on a condition. I have Fragment0, and also Fragment1, Fragment2, ... FragmentN all extending Fragment0, and being all of them (including Fragment0) able to be that wished start destination . I already know there is the method from NavGraph called setStartDestination(R.id.nav_fragment_X); but it is not useful for me because, if I am not wrong, it requires to have all these fragment0...N nodes declared in the

Android NavigationUI startDestination class (not ID) programmatically

陌路散爱 提交于 2020-03-04 18:56:49
问题 I need to set the start destination of a navigation graph programmatically depending on a condition. I have Fragment0, and also Fragment1, Fragment2, ... FragmentN all extending Fragment0, and being all of them (including Fragment0) able to be that wished start destination . I already know there is the method from NavGraph called setStartDestination(R.id.nav_fragment_X); but it is not useful for me because, if I am not wrong, it requires to have all these fragment0...N nodes declared in the

Disabling the current tab in a bottom navigation controller

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-30 03:16:38
问题 I'm using Jetpack Navigation to handle the bottom navigation controller. It works great; however, I am looking for a way to improve the UX. Is it possible to disable the tab that the user is currently navigated to? I'm able to "spam" the current tab in the bottom navigation, which reloads data & the UI unnecessarily. If this behavior (of re-tapping the current tab) is intended, is there a way to retain the state of the fragment, so that when navigated away & to, it doesn't recreate? How I