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

后端 未结 5 1486
遇见更好的自我
遇见更好的自我 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:43

    I got the solution using your answers, thanks :). Actually the issue was with the list view. I was getting the linear layout on the left drawer, however it wasnt displayed properly as I added a scroll View to my linear layout and I also had a list in the same view which displayed only the first item in the list leaving the entire screen space blank. I checked few links to get the answer but it didn't work. At the end, since the list data is known to me and it will not change dynamically I added RadioButtons, customized them and replaced the list.

    My code looks like below now.

    
    
    
    
    
    
    
    
    
    
        
    
            
    
            
    
            
    
                
    
                
    
                    
    
                    
    
                        
    
                        
                    
                
            
    
            
    
            
    
            
    
                
    
                
    
                
    
                
    
                
    
                
    
                
    
                
    
                
    
                
    
                
            
    
            
        
    
    

    I know this might not be the best possibility but at least its working for me. If any one has a better solution, then please let me know.

提交回复
热议问题