219 Android Navigation Drawer Tutorial Part 2 |
Why Stack Overflow recommends it
Stack Overflow users link it when they are following the tutorial to build a navigation drawer and need to point to the exact step where their code or setup went wrong.
Recommended by 1 people across 1 different months, 2015 to 2015.
What it is
A 13-minute Android tutorial from the slidenerd channel, part 2 of a Navigation Drawer series. It shows how to build a drawer with DrawerLayout, a NavigationDrawerFragment and ActionBarDrawerToggle together with a v7 Toolbar.
What people said
Recommends alvin valdez · 2015-02 · Stack Overflow · on “NullPointerException when trying to make a drawer”
found the answer!! there was added override methods upon creation of my navigation drawer thats why. I tried creating a new NavigationFragmentDrawer class and xml by: right-click on my java package then new > fragment > fragment (blank) at this moment uncheck the "Include fragment factory methods" and "include interface callbacks" check 1:30 - 1:45 of this tutorial: [this video]
Cites anon · 2015-07 · Stack Overflow · on “Rendering Problems The following classes could not be found: - android.support.v4.widget.DrawerLayout (Fix Build Path, Create Class)”
I learn material design with this video: [this video] and I get this error : A Part of build.gradle : dependencies { compile 'com.android.support:support-v4:22.2.0' compile 'com.android.support:appcompat-v7:22.2.0' } And activity_main.xml : <android.support.v4.widget.DrawerLayout xmlns:android=" [LINK] " xmlns:tools=" [LINK] " xmlns:app=" [LINK] " android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/drawer_layout"> <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" android:background="#363537" tools:context=".MainActivity"> <TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wra
Cites Princeps Polycap · 2015-08 · Stack Overflow · on “findViewById (int) in Activity cannot be applied to (int, android.support.v7.widget.Toolbar”
So I have been following Slidnerd tutorial on the Navigation Drawer [this video] . The problem arises when I'm trying to create an instance of ActionBarDrawerToggle to specify the Activity , the DrawerLayout and the Toolbar . (NavigationDrawerFragment)getSupportFragmentManager().findFragmentById(R.id.fragment_nav_drawer); drawerFragment.setUp((DrawerLayout) findViewById (R.id.drawer_layout, toolbar); I'm getting an error underlying the (R.id.drawer_layout, toolbar) . The error says: " findViewById (int) in Activity cannot be applied to (int, android.support.v7.widget.Toolbar" . I tried a suggested solution which was to import android.support.v4.app.Fragment but even after trying this the problem