NullPointerException with android.support.v7.widget.Toolbar

后端 未结 12 977
旧巷少年郎
旧巷少年郎 2021-01-07 17:53

I am currently trying to implement a navigation drawer in my app. I am having an issue with the Toolbar being null. I have done many searches online and tried many different

12条回答
  •  死守一世寂寞
    2021-01-07 18:21

    I read another time your code...and I saw that you haven't defined the ID of your toolbar in your MainActivity XML...see your include in it :

    
    
    
    
    
    
    
    
    
    

    After that...you won't get this error 'cause your toolbar is finally found and isn't set to 'null'.

提交回复
热议问题