Best Navigation Drawer Tutorial on Android (Part 1)

Oum Saokosal · 258K views · 2016 · 36:29

Open on YouTube

Software (other)Web developmenttutorialdated

Why Stack Overflow recommends it

Stack Overflow users cite it as the tutorial they followed when learning navigation drawer activities and wiring fragments into the Android Studio template, often while asking why their version crashes.

Recommended by 1 people across 1 different months, 2016 to 2019.

What it is

A 36-minute Android Studio tutorial by Oum Saokosal on building a navigation drawer from the built-in template. It covers changing the icon, color and menu, and how to add fragments to the drawer.

What people said

Recommends Tom · 2016-09 · Stack Overflow · on “How do you maximize a fragment (in Android) but not make it fullscreen?”

Thank you. I've updated the original question with the full fragment layout. I just have a TextView on there at the moment? I'm following this tutorial to learn about navigation drawer activities: [this video]

Cites Ivan · 2016-10 · Stack Overflow · on “Android Studio Error - Fragment - Navigation drawer”

When I Run the app I get the following error: 10-20 14:47:22.829 29044-29044/com.example.ivanp.meteostanica E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.ivanp.meteostanica, PID: 29044 java.lang.ClassCastException: android.support.v7.widget.AppCompatTextView cannot be cast to android.view.ViewGroup at android.support.v4.app.BackStackRecord.configureTransitions(BackStackRecord.java:1153) at android.support.v4.app.BackStackRecord.beginTransition(BackStackRecord.java:1060) at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:662) at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1617) at android.support.v4.app.FragmentManagerImpl$

Cites Rob · 2019-06 · Stack Overflow · on “Launching fragments from Navigation Drawer causes app to crash”

As the question states i am trying to launch a fragment from the Android Studio prebuilt Navigation Drawer template. I tried following this guys video here [this video] . During testing sometimes his way would work and sometimes it would not but, I always used the same bit of code. public boolean onNavigationItemSelected(MenuItem item) { // Handle navigation view item clicks here. int id = item.getItemId(); if (id == R.id.nav_home) { // Handle the camera action } else if (id == R.id.nav_gallery) { Facebook facebookFrag = new Facebook(); FragmentManager manager = getSupportFragmentManager(); manager.beginTransaction().replace(R.id.homeLanding,facebookFrag,facebookFrag.getTag()).commit(); } else if