Skip to content Skip to sidebar Skip to footer

Android: Custom Adapter With Custom Spinner Drop Down Xml Layout Giving Error

I have a spinner with a custom adapter that I used to set the height of the first element in the spinner drop down to zero. I do this to have a default message in my spinner (first

Solution 1:

textView is null so NPE..change it in R.id.text1 instead of android.R.id.text1

TextView textView = (TextView) convertView.findViewById(android.R.id.text1);
                                                        ^^^^^^^^     

Post a Comment for "Android: Custom Adapter With Custom Spinner Drop Down Xml Layout Giving Error"