× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

Need clarification on how the native Navigation Drawer works with Fragments

Xaver Kapeller
Mar 13, 2015
<p>For navigation in Android there is always one thing you have to remember:</p> <ul> <li>If you stay on the same level of the navigation hierarchy, for example when swiping through pages, you use <code>Fragments</code>.</li> <li>When you move up and down in the navigation hierarchy, for example going to a detail view, you would start a new <code>Activity</code> and displayed the <code>Fragment</code> with the detail content in it.</li> </ul> <p>A <code>NavigationDrawer</code> is used for top level navigation in your app to quickly navigate between different parts of your app. It's kind of like a main menu. With that in mind you need to determine if a <code>NavigationDrawer</code> makes sense in your app. It's all about how the user should navigate through the content. If there is just one path for the user to follow for example if you start out with just one screen and from then on the user can just go deeper and deeper in the navigation hierarchy from one detail view to the next than a <code>NavigationDrawer</code> does not make much sense. But if there are multiple paths the user can take that lead into different, independent parts of your app without one dedicated start screen on which everything else depends than a <code>NavigationDrawer</code> sounds pretty reasonable.</p> <p>You can look at Google apps like Gmail, Drive or Google+ to see how a <code>NavigationDrawer</code> is supposed to be used.</p> <p>This tip was originally posted on <a href="http://stackoverflow.com/questions/23598877/Need%20clarification%20on%20how%20the%20native%20Navigation%20Drawer%20works%20with%20Fragments/23599225">Stack Overflow</a>.</p>
comments powered by Disqus