I am working on a project which I saw in a video tutorial. But when I write app:menu="@menu/bottom_navigation_menu"
to link customized menu, I have a problem. It is not work properly. This is my code error image.
Asked
Active
Viewed 4,176 times
0

Abdul Waheed
- 4,540
- 6
- 35
- 58

Sahan Pasindu Nirmal
- 433
- 4
- 13
- 36
2 Answers
4
You need to add
xmlns:app="http://schemas.android.com/apk/res-auto"
to your main xml element

Chris Gomez
- 6,644
- 4
- 18
- 39
-
In this xml file? instead xmlns:android="http://schemas.android.com/apk/res/android" this? – Sahan Pasindu Nirmal Oct 19 '17 at 15:11
-
no, they are not the same they should be both there, you can put xmlns:app="http://schemas.android.com/apk/res-auto" bellow xmlns:android="schemas.android.com/apk/res/android" – Chris Gomez Oct 19 '17 at 15:25
-
work 100% thank you so much sir – Sahan Pasindu Nirmal Oct 19 '17 at 15:28
1
I am assuming you are using drawer layout at your root layout. If that is the case then Add below line of code to your drawer layout
xmlns:app="http://schemas.android.com/apk/res-auto"

Abdul Waheed
- 4,540
- 6
- 35
- 58