Skip to content

Instantly share code, notes, and snippets.

@CreatorB
Created February 18, 2015 00:51
Show Gist options
  • Save CreatorB/2e3d65612a004d5ce09b to your computer and use it in GitHub Desktop.
Save CreatorB/2e3d65612a004d5ce09b to your computer and use it in GitHub Desktop.
Cannot cast from View to Spinner
Are you sure you imported android.widget.Spinner and not something else named the same thing? Maybe try the following, just to be sure, change your error line to :
android.widget.Spinner s = (android.widget.Spinner) findViewById(R.id.spinner);
If it doesn't give you a problem there then odds are high that you have a namespace problem.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment