I'm trying to add a Navigation Menu to an existing project in Android Studio. However, while following the instructions on the official website, I added a <android.support.v4.widget.DrawerLayout ...
tag around the rest of my view, and under the main ConstraintLayout that has the main activity layout, I put the sample Navigation Draw underneath that:
<android.support.design.widget.NavigationView
android:id="@+id/navigation"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
app:menu="@menu/my_navigation_items" />
The last line causes some problems though when building:
Error:error: attribute 'com. ... :menu' not found.
I can't figure out why this is happening. The app
part of app:menu
is defined in the DrawerLayout tag as: xmlns:app="http://schemas.android.com/apk/res-auto"
This seems to also have the effect of giving me the error Cannot resolve symbol R
in my MainActivity.java file.
Anyway, any help is very much appreciated!
my_navigation_files.xml
file inside it. – Nambypamby