android - How can I open a Fragment under the open NavigationDrawer with defining the Drawer in a separate fragment? -
android - How can I open a Fragment under the open NavigationDrawer with defining the Drawer in a separate fragment? - my app opens navigationdrawer @ start. when user clicks on item in fragment beingness replaced. for every item in navigation drawer have separate fragment. when user not take of options in navigationdrawer , closes it, main activit layout beingness shown. i want 1 of own fragments brought when user closes side menu. (navigation drawer) npe when seek change setcontentview(r.layout.activity_main); with setcontentview(r.layout.my_fragment); (because cannot find navigation_drawer since defined in activity_main) i don't set navigationdrawer in 1 of fragments, neither re-create fragment elements main.xml (it messy design :( ). supposed do? how supposed open desired fragment underneath navigationdrawer?? here oncreate in mainactivity: @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate);...