Josh Dobbs wrote:
> I changed the code to just use the following array for testing purposes
> and i still get the null pointer exception. anyone have any ideas as to why?
>
> String[] array = {"this", "is", "driving", "me", "crazy"};
>
> Spinner spinner_drawings = (Spinner) findViewById(R.id.spinner_drawings);
> ArrayAdapter<String> adapter = newArrayAdapter(this,
> android.R.layout.simple_spinner_item, array);
> adapter.setDropDownViewResource
> (android.R.layout.simple_spinner_dropdown_item);
> spinner_drawings.setAdapter(adapter);//this is where it bombs out and i
> have to close the application
1. Have you called setContentView() before your call to findViewById()?
2. Does your layout have a Spinner element with
android:id="@+id/spinner_drawings"?
--
Mark Murphy (a Commons Guy)
http://commonsware.com
Android Training on the Ranch! -- Mar 16-20, 2009
http://www.bignerdranch.com/schedule.shtml
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---