title: Navigation hierarchy on Android?
body: <p>I've recently been looking into the navigation system that Android uses with as intention to port my iOS app that uses an <code>UITabBarController</code> containing multiple <code>UINavigationController</code>s. To replace the tab bar (which is not available on Android) I settled on using the built in <code>DrawerLayout</code>.</p>
  
  <p>From what I've read, navigation in Android is generally done by creating an <code>Intent</code>, providing it with extras and then just replacing the current activity. This automatically makes sure the back button works, and optionally the back button in the top left if enabled.</p>
  
  <p>However, I am not sure how to implement this way of navigation with <a href="http://developer.android.com/training/implementing-navigation/nav-drawer.html" rel="nofollow">the navigation drawer</a>. The tutorial tells me to create a <code>DrawerLayout</code> containing a <code>FrameLayout</code> and a <code>ListLayout</code> where the <code>FrameLayout</code> will contain the actual application and the <code>ListLayout</code> will contain the navigation. This would mean that when I use the method described above to "navigate", it would replace the activity and thus removing the drawer.</p>
  
  <p>What would be the best way to implement what I want (basic navigation with back button support while maintaining a global drawer navigation menu)? The possible options I can come up with is always keeping the same activity and dynamically replacing the <code>FrameLayout</code>, but that would mean a lot of boilerplate to render and possibly a hack to support the back button (and there would be no animations :(). The other option would be to just render the drawer on every activity (via subclassing or something), but that would mean that if the user navigates a lot the back button "stack" would become quite large.</p>
  
  <p>I have tried to explain what I need in as much detail as possible, but it is quite hard to explain the concept. Basically, I want something similar to the <code>UINavigationController</code>s in the <code>UITabBarController</code>.</p>