2

I am using a DrawerLayout for the main menu. By clicking one of the menu items, I start an activity that has a master-detail relationship (that uses SlidingPaneLayout). However, when the user closes the navigation drawer and does not choose any menu item, he is presented with a blank screen, which I find is annoying. I would like to present the master-detail relationship (that uses the SlidingPaneLayout) instead.

Reading the documentation for DrawerLayout, I understood that the DrawerLayout can have only two child elements - a FrameLayout and a ListView. I was wondering if it is possible to incorporate a SlidingPaneLayout with a DrawerLayout?

Thank you.

user2808089
  • 49
  • 1
  • 5

1 Answers1

0

There's no problem to do that. The DrawerLayout can have only two child, but of any kind. You can for example have two framelayouts, and replace one of them with a fragment containing a SlidingPane. I've actually done that on some projects without problems.

OriolJ
  • 2,762
  • 1
  • 28
  • 22