jstoezel wrote:
> Hi,
> 
> I'm getting a runtime exception when calling the last line of the
> following code:
> 
> Spinner s = (Spinner) findViewById(R.id.samplingTimeSpinner);
> ArrayAdapter adapter = ArrayAdapter.createFromResource(this,
> R.array.samplingRate, android.R.layout.simple_spinner_item);
> adapter.setDropDownViewResource
> (android.R.layout.simple_spinner_dropdown_item);
> s.setAdapter(adapter);
> 
> I have no idea why this is happening. Any idea what causes this?

What is the exception? You can get the Java stack trace from adb logcat,
DDMS, or the DDMS perspective in Eclipse.

If you get a NullPointerException, try using R.id.samplingtimespinner
(note all lowercase).

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

_Android Programming Tutorials_ Version 1.0 Available!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to