navigation

How to set 'hardwareBackPress' to another Stack

那年仲夏 提交于 2020-04-30 11:46:58
问题 //TermsPage.tsx const resetAction = StackActions.reset({ index: 0, actions: [NavigationActions.navigate({ routeName: 'BottomTabNav', params:{showTerms:false} }), ], }); componentWillUnmount() { BackHandler.addEventListener('hardwareBackPress',()=>{ this.props.navigation.dispatch(resetAction) return true }) } How to set 'hardwareBackPress' eventListenner to navigate to another StackNavigator. If I set like above. This backpress work in all Pages. I want to set this listener only for TermsPage.

Recovery behavior clears the obstacle layer

久未见 提交于 2020-04-30 06:29:23
问题 I am using RP-Lidar /scan topic together with move_base from navigation stack. Although the obstacle layer is parameterized to get the LaserScan type data from /scan topic, I am recieving the message that "Recover behavior will clear layer 'obstacles'". I would like to mention that the UniTest over /scan topic and /odom topic are working fine. Thus in my RVIZ, the obstacle are not shown neither the planner takes them into account to prevent a collision. For clarity here is my common config

ConstraintLayout does not have a NavController set for item clicked on RecyclerView

拥有回忆 提交于 2020-04-18 02:40:27
问题 When I click on an item, sometimes it works and sometimes it crashes. Below is the FATAL EXCEPTION after clicking on an item. 2020-03-31 21:59:18.087 15383-15383/com.aliton.myapp E/AndroidRuntime: FATAL EXCEPTION: main Process: com.aliton.myapp, PID: 15383 java.lang.IllegalStateException: View androidx.constraintlayout.widget.ConstraintLayout{b3bb13b V.E...C.. .......D 0,336-720,518} does not have a NavController set at androidx.navigation.Navigation.findNavController(Navigation.java:84) at

Flutter navigation

痞子三分冷 提交于 2020-04-16 12:48:48
问题 Can someone explain why not printing efeioi when it is back from pageE? Page A Navigator.pushNamed(context, PageB.ROUTE).then((onValue) { print("efeioi"); }); Page B Navigator.of(context) .pushReplacementNamed(PageC.ROUTE, arguments: onValue); PageC Navigator.pushNamed(context, PageD.ROUTE, arguments: onValue); PageD Navigator.pop(context); // back to Page C Page C Navigator.pushNamed(context, PageE.ROUTE, arguments: onValue); Page E Navigator.of(context).popUntil(ModalRoute.withName(PageA

Flutter navigation

天涯浪子 提交于 2020-04-16 12:47:51
问题 Can someone explain why not printing efeioi when it is back from pageE? Page A Navigator.pushNamed(context, PageB.ROUTE).then((onValue) { print("efeioi"); }); Page B Navigator.of(context) .pushReplacementNamed(PageC.ROUTE, arguments: onValue); PageC Navigator.pushNamed(context, PageD.ROUTE, arguments: onValue); PageD Navigator.pop(context); // back to Page C Page C Navigator.pushNamed(context, PageE.ROUTE, arguments: onValue); Page E Navigator.of(context).popUntil(ModalRoute.withName(PageA

how to add the Navigation View using Java Code

荒凉一梦 提交于 2020-04-16 05:47:30
问题 I'm using androidx for development and I'm trying to use the NavigationView and since the findViewById doesn't usually work when you need it to, I'm trying to do everything in Java Code. So, I'm trying to get this NavigationView to appear, but this seems to be missing something: public class MainActivity extends AppCompatActivity { Activity_Animation001_Layout animation001_layout; Animation_Activity002 animLay2; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate

how to add the Navigation View using Java Code

蓝咒 提交于 2020-04-16 05:46:34
问题 I'm using androidx for development and I'm trying to use the NavigationView and since the findViewById doesn't usually work when you need it to, I'm trying to do everything in Java Code. So, I'm trying to get this NavigationView to appear, but this seems to be missing something: public class MainActivity extends AppCompatActivity { Activity_Animation001_Layout animation001_layout; Animation_Activity002 animLay2; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate

Android Navigation - After deeplink navigation to second fragment, open first fragment in the same graph, but from another navigation graph

倾然丶 夕夏残阳落幕 提交于 2020-04-16 02:58:25
问题 In my navigation, I have something like this: When I open registrationFragment (in entry_graph) from a deep-link, and finish registration, I am navigated to main_graph (MainFragment). From there, I can access to menuFragment and click on logOut, which calls: MainFragmentDirections.actionMainFragmentToEntryFragment() It opens the registrationFragment instead of loginFragment. I do not expect that since loginFragment is the home fragment on that graph. When I have similar navigation but not

Android Navigation - After deeplink navigation to second fragment, open first fragment in the same graph, but from another navigation graph

淺唱寂寞╮ 提交于 2020-04-16 02:58:13
问题 In my navigation, I have something like this: When I open registrationFragment (in entry_graph) from a deep-link, and finish registration, I am navigated to main_graph (MainFragment). From there, I can access to menuFragment and click on logOut, which calls: MainFragmentDirections.actionMainFragmentToEntryFragment() It opens the registrationFragment instead of loginFragment. I do not expect that since loginFragment is the home fragment on that graph. When I have similar navigation but not

FragmentContainerView as NavHostFragment

亡梦爱人 提交于 2020-04-12 07:50:28
问题 Seems like using the FragmentContainerView doesn't work right out of the box? <androidx.fragment.app.FragmentContainerView class="androidx.navigation.fragment.NavHostFragment" android:id="@+id/fragment_nav_host" android:layout_width="match_parent" android:layout_height="match_parent" app:defaultNavHost="true" app:navGraph="@navigation/nav_app" /> Here's my code using fragment-ktx:1.2.0-rc01 and I'm just always getting this error: Caused by: java.lang.IllegalStateException: Activity ..