Skip to content Skip to sidebar Skip to footer

Spinner If Item Selected Again

I created a class file in my package, called NoDefaultSpinner. When I try to use it in my Android app, though, I get an exception that crashes the program. I copied the code provid

Solution 1:

Your first exception is caused by

java.lang.ClassNotFoundException: Didn't find class"android.view.NoDefaultSpinner" on path: /data/app/com.example.life-1.apk

So use the fully qualified name (com.myPackage.NoDefaultSpinner) in your xml layout. Otherwise, Android assumes the class is part of its own package and it will obviously fail.

Also, this:

ClassCastException: android.widget.Spinner cannot be cast to com.example.life.NoDefaultSpinner

Suggests that NoDefaultSpinner does not extend Spinner, make sure it is.

Post a Comment for "Spinner If Item Selected Again"