MultiSelectSpinner
MultiSelectSpinner copied to clipboard
canot cast to class MultiSelectSpinner
MultiSelectSpinner mySpin = (MultiSelectSpinner)findViewById(R.id.spinner1);
Caused by: java.lang.ClassCastException: android.widget.Spinner cannot be cast to com.example.testspinner.MultiSelectSpinner
why?
I was having the same problem and looking all over to find the answer. What I ended up needing to do is go to my layout.xml file where it would normally say <Spinner ... ... > and replace the <Spinner with <com.sample.app.MultiSelectSpinner. I had the included Java file on here in that Java directory. If it's in a lower package directory it'd become something like <com.sample.app.folder1.MultiSelectSpinner etc...