Monday, February 6, 2012

[android-developers] Re: Source not found/ArrayAdapter

Sorry for being so vague the first time. I was in a rush! Heres the
code thats causing the error:

CODE

String[] spinnerArray =
getResources().getStringArray(R.array.a_chords);
Spinner spinner = new Spinner(this);
ArrayAdapter<String> spinnerArrayAdapter = new
ArrayAdapter<String>(
this, android.R.layout.simple_spinner_item,
spinnerArray);

spinnerArrayAdapter.setDropDownViewResource( android.R.layout.simple_spinner_dropdown_item );


spinner = (Spinner) findViewById( R.id.choose_key);
spinner.setAdapter(spinnerArrayAdapter);
setContentView(R.layout.main);

CODE

The array I'm getting from the resources is here:

<string-array name="a_chords">
<item >A</item>
<item >Bm</item>
<item >C#m</item>
<item >D</item>
<item >E</item>
<item >F#m</item>
<item >E7th</item>
</string-array>

Heres the logcat:

java.lang.NullPointerException

any ideas?

On Feb 6, 12:04 pm, TreKing <treking...@gmail.com> wrote:
> On Sat, Feb 4, 2012 at 2:57 PM, Ozone Apps <ozoneforandr...@gmail.com>wrote:
>
> > Any ideas?
>
> Debug your app.
> Explain "throwing a Serouce Not Found error".
> Post a logcat.
> Show some code.
>
> --------------------------------------------------------------------------- ----------------------
> TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
> transit tracking app for Android-powered devices

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate