Adding a linear layout to Navigation drawer (ends up crashing with a ClassCastException)

后端 未结 5 1459
遇见更好的自我
遇见更好的自我 2020-12-10 07:06

I am trying to add a vertical linear layout (having a title, image, menu title, listview and an icon at the bottom)to the navigation drawer. However the app crashes displayi

5条回答
  •  伪装坚强ぢ
    2020-12-10 07:47

    Try doing this,

    In function selectItem, change mDrawerLayout.closeDrawer(mDrawerList); to mDrawerLayout.closeDrawer(mDrawerLinear); Should work perfectly fine.

    Because, the reference should now be your linearLayout, its no longer the listview that you are closing or opening.

提交回复
热议问题