144 Android Navigation Drawer Tutorial Part 1 |
Why Stack Overflow recommends it
Stack Overflow users link it when answering questions about getting an Android navigation drawer working with activities, fragments and lists.
Recommended by 4 people across 4 different months, 2014 to 2016.
What it is
A 13-minute Android tutorial from the slidenerd channel, part 1 of a series on building a navigation drawer. It walks through declaring a DrawerLayout in XML with a FrameLayout for main content and a ListView as the drawer, and using layout_gravity to set the slide direction.
What people said
Recommends DRY Believer · 2014-08 · Stack Overflow · on “Why won't my Android Navigation Drawer Open”
Your xml seems to be fine but y r u inflating the menu_drawer.xml in fragment and not on an Activity ..Check out this video for better idea :: [this video] this is my code.. activity_main.xml <android.support.v4.widget.DrawerLayout xmlns:android=" [LINK] " android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/drawerlayout"> <FrameLayout android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/maincontent"></FrameLayout> <ListView android:background="#FFFFFF" android:divider="@null" android:layout_width="240dp" android:layout_height="match_parent" android:id="@+id/drawerlist" android:layout_gravity="left"> </ListView> </android.s
Recommends silverFoxA · 2015-04 · Stack Overflow · on “Navigation Drawer Activity”
Check this link for better understanding on navigationdrawer enter link description here [this video] Once you have your navigation drawer done put a listview in the drawer layout and put setOnclickListener to those. Use Intents to specify them where to go. Hope it helps
Recommends Pier Giorgio Misley · 2015-08 · Stack Overflow · on “Go from Activity to Fragment on NavigationDrawer”
Ok, i can try giving you a solution: instead of creating a new view, you can add all fragments to the SplashActivity following this [LINK] guide. Than set all fragment to be with View.GONE . Once an user click a button, change the View property of the related fragment to Visible and all others to Gone . Doing this everytimes an user clicks a button, all Fragments disappears except the one you need. This should work but i suggest to have a look to official documentation [LINK] or this [this video] guide on how to use NavigationDrawer propertly. Hope i helped, good luck!
Recommends suku · 2016-03 · Stack Overflow · on “Android: NavigationDrawer/multiple activities/same menu”
From what I understand, you want the navigation drawer to be present in every activity. There are two methods: Use @Russell's answer. Make a main activity having a framelayout usually called content_frame which covers the whole activity. This activity has the code for the navigation drawer. On button click you can replace the contents of this layout with the layout of the desired fragment (i.e. either fragment with several buttons or say an image). So the elements in the drawer are all fragments. In the tutorials the fragments are called through getFragmentManager(). Check out the video series on navigation drawer by this guys, slidenerd: [this video] . Try to implement it as you are going along
Cites silverFoxA · 2015-04 · Stack Overflow · on “Extending viewpager with navigation drawer”
If you are looking for a Navigation Drawer on top of the ViewPager here's what you can do: Incase if you don't know about the Navigationdrawer properly please check this link ( Click Here [this video] ) use this code within your relative Layout <android.support.v4.widget.DrawerLayout xmlns:android=" [LINK] " xmlns:tools=" [LINK] " android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/custom_drawer_layout"> <RelativeLayout android:id="@+id/relative" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <android.support.v4.view.ViewPager android:id="@+id/pager" android:layout_width="fill_parent" android:layout_hei