Android Jetpack: manage UI navigation with Navigation Controller (Google I/O '18)



The Navigation Architecture Component provides a framework for building in-app navigation. This session will discuss how to use the Navigation Editor in Android Studio, XML or the Java API to define your navigation graph, and how that simplifies navigating around your app and handling deep linking.

Rate this session by signing-in on the I/O website here →

Watch more Android sessions from I/O ’18 here →
See all the sessions from Google I/O ’18…

49 Comments

  1. Prior to migrating to androidx I used the support navigation activity and heavily used activities as opposed to fragments.On migration to androidx i got an error on oncreate.How then do i use the navigation controller on layouts because it only accepts R.id.next and not R.layout.next

  2. Hello, I tried this but I have an issue accessing a nested graph fragment inside another nested graph from the root navhost. (Like from Home to contacts nested graph, contacts being inside the account nested graph). Global action does not work from root only from the account nested graph. And if I extract contacts from the account nested graph it works BUT the "selected" icon in my bottom navigation view will be "home" and not "account" :'(

  3. There is no proper way to update the toolbar based on the navigation destination… Currently It's basically impossible to implement a destination with a SearchView in the toolbar…

  4. Every back button or navigation item selection recreates the whole fragment. So what is the use of this if I can't keep the last state of the fragment state.

  5. How to prevent fragment recreate during pop behavior ? Like Second fragment to first fragment .

  6. Nice! I will be happy to follow and learn from you. 😛

    Oh by the way, is it ok if I can also seek your advice in this open source android app I have posted below? Just need some feedback about it…

    Just need to search ' pub:Path Ahead ' in Google Play (P & A are case sensitive).

    thanks a-hundred !!

  7. The details are so satisfying and awesome !! 🙂

    Oh by the way, is it ok if I can also seek your advice in this open source android app I have posted below? Just need some feedback about it…

    http ://bit. ly/2tldxaG

    thanks a-hundred-times !!

  8. Navigation component crashes.
    java.lang.IllegalArgumentException: navigation destination 
    😫😫😫😫

  9. Hello from 2019, navigation editor not working properly, as always all new features not production-ready – data binding, navigation… Looks like experiment, but not as usable feature.

  10. How to manage fragment state duting backstack. Like first contains recyclerview and user scroll to end then onitemclick navigate to second screen. now if user back to previous fragment there is not state managed. it is possible or not.if possible how to manage ?

  11. why they copy ios i dont understand and even if they copy they cam make it better but these are only good for fragment transactions Not activity result

  12. put speed to at least 2x
    I need more than that via JS hack
    x)

  13. You can't use findViewById in a fragment… getview()?.findViewById is correct ?

  14. Finally after 10 years they are starting to understand that Android Fragments and UI design are completely shitty… And then they take inspiration from Apple ? Really ? What is going wrong with you Google ?

  15. Added depdencies, still unable find this "navigation editor". Anyone had any luck with this ?

  16. Why call it NavHost instead of NavigationHost? just introduces unnecessary inconsistency

  17. With larger applications with many fragments – can you have multiple .xml files for the navigation graph or can you only have one very large graph for the entire project?

  18. Can a fragment in the navigation graph have multiple pop-to fragments? Can a navigation graph looks like a net?
    For example in the case of 06:17, what if an app has multiple entries to the user_profile? Or I'll need to create multiple separate paths?

  19. Okay so this explained some parts. But what about master-detail flows on tablets? How do I tell it whether I'm on a phone or tablet ui and where to load the fragment to? How would I modify the ActionBar Menu? What about Activities deeper in the hirarchy where I want an Up-arrow even on the topmost fragment to go up to another activity? So many things that are currently not explained anywhere, so we'll need to wait for blog posts and stackoverflow questions to pop up to fill all the blanks. Just like every io unfortunately. Things will be usable around the P release.

  20. Will there be a
    implementation 'android.arch.navigation:navigation-activity:1.0.0-alpha01'
    that fixes the up and back button handling for activities without the need to switch to this Fragment style?

  21. How do I handle CollapsingToolbarLayout for specific Fragment if I have Toolbar that is placed in the Activity?
    Do I hide the Activity's Toolbar and then handle Fragment's Toolbar separately? How will this affect the up navigation?

  22. I waited so much time for something like this. It's a big improvement for the Android developers life! Thank you!

Leave a Reply

Your email address will not be published. Required fields are marked *