I am trying to implement a Navigation drawer, but I keep getting this error. I saw the similar questions but did not work for me. I have the following layout activity_main2.
My DrawerLayout was inside a LinearLayout:
Then I solved the problem by changing the layout_height="wrap_content" to layout_height="match_parent" of LinearLayout.So the code is:
layout_height="wrap_content"
layout_height="match_parent"
LinearLayout