I'm making a simple navigation drawer, however my header.xml is not showing up in my navigation_drawer.xml.
I doubled checked and everything and it seems okay. Did I miss something or do something wrong?
Thankyou!
activity_navigation_drawer.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:openDrawer="start"
android:background="@color/black"
tools:context=".NavigationDrawer"
android:id="@+id/drawer">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.appcompat.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/toolbar"
android:background="@color/black"/>
</RelativeLayout>
<com.google.android.material.navigation.NavigationView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/navigationView"
app:menu="@menu/menu_item"
app:headerLayout="@layout/header"
android:background="@color/seekbar_container_color"/>
</androidx.drawerlayout.widget.DrawerLayout>
header.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="@color/activated_btn_color">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/brightness_icon"
android:layout_gravity="center"
android:tint="@color/white"
android:layout_marginTop="20dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/btn_txt"
android:textSize="20sp"
android:textColor="@color/white"
android:layout_gravity="center"
android:layout_marginTop="3dp"/>
</LinearLayout>
styles.xml snippet:
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"></style>

