Fix crashes where R.id.navigation_view wasn't found

This commit is contained in:
veyndan 2017-07-03 07:10:22 +01:00
parent b83c32f81e
commit 6c47fa3c89
2 changed files with 14 additions and 23 deletions

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
@ -22,17 +23,12 @@
android:orientation="vertical"></FrameLayout>
</RelativeLayout>
<RelativeLayout
android:id="@+id/drawer_pane"
android:layout_width="320dp"
android:layout_height="match_parent"
<android.support.design.widget.NavigationView
android:id="@+id/navigation_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="@android:color/white">
app:headerLayout="@layout/drawer_header"
app:menu="@menu/drawer" />
<FrameLayout
android:id="@+id/drawer_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
</android.support.v4.widget.DrawerLayout>
</android.support.v4.widget.DrawerLayout>

View file

@ -36,17 +36,12 @@
</FrameLayout>
</RelativeLayout>
<RelativeLayout
android:id="@+id/drawer_pane"
android:layout_width="320dp"
<android.support.design.widget.NavigationView
android:id="@+id/navigation_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="@android:color/white">
app:headerLayout="@layout/drawer_header"
app:menu="@menu/drawer" />
<FrameLayout
android:id="@+id/drawer_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
</android.support.v4.widget.DrawerLayout>
</android.support.v4.widget.DrawerLayout>