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 3,995 times
0
Abdul Waheed
- 4,304
- 5
- 32
- 53
Sahan Pasindu Nirmal
- 401
- 3
- 12
- 33
2 Answers
3
You need to add
xmlns:app="http://schemas.android.com/apk/res-auto"
to your main xml element
Cristian Gomez
- 6,094
- 4
- 17
- 38
-
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" – Cristian 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,304
- 5
- 32
- 53