[android-developers] Re: Looking for documentation on showing a value from a string-array in a TextView

2011-05-16 Thread Nicholas Johnson
Something like this should work: String[] textValues = getResources().getStringArray(R.array.your_string_array); for (int i = 0; i < textValues.length; ++i) { mTextView.setText(textValues[i]); } ^obviously this code isn't very useful, but you get the idea. Nick -- You received this mess

[android-developers] Re: Looking for documentation on showing a value from a string-array in a TextView

2011-05-16 Thread Spooky
On May 16, 7:15 pm, Nicholas Johnson wrote: > Something like this should work: > > String[] textValues = > getResources().getStringArray(R.array.your_string_array); > > for (int i = 0; i < textValues.length; ++i) { >mTextView.setText(textValues[i]); > > } > > ^obviously this code isn't very

[android-developers] Re: Looking for documentation on showing a value from a string-array in a TextView

2011-05-16 Thread Zsolt Vasvari
Just one comment -- not really specific to Android, but Java in general: You should be using the "most" base class that you can get away with, so in the case of Android, 99% of the time you can use CharSequence instead of String, so your code would be: CharSequence[] textValues = getResources().g

[android-developers] Re: Looking for documentation on showing a value from a string-array in a TextView

2011-05-16 Thread Zsolt Vasvari
Speaking of CharSequence: the TextUtils helper class has a lot of useful methods of working with CharSequence objects. You can basically do anything that you with String objects, such as equals(), contact(), indexOf(), etc. indexOf() is a replacement with startsWith(). Which is why I said you c

[android-developers] Re: Looking for documentation on showing a value from a string-array in a TextView

2011-05-16 Thread Spooky
On May 16, 7:15 pm, Nicholas Johnson wrote: > Something like this should work: > > String[] textValues = > getResources().getStringArray(R.array.your_string_array); > > for (int i = 0; i < textValues.length; ++i) { >mTextView.setText(textValues[i]); > > } > > ^obviously this code isn't very

[android-developers] Re: Looking for documentation on showing a value from a string-array in a TextView

2011-05-16 Thread Spooky
On May 16, 7:15 pm, Nicholas Johnson wrote: > Something like this should work: > > String[] textValues = > getResources().getStringArray(R.array.your_string_array); > > for (int i = 0; i < textValues.length; ++i) { >mTextView.setText(textValues[i]); > > } > > ^obviously this code isn't very

[android-developers] Re: Looking for documentation on showing a value from a string-array in a TextView

2011-05-17 Thread Spooky
On May 16, 9:39 pm, Spooky wrote: The same post twice. Sorry, not sure how that happened -- 73 DE N5IAL/4 Web site: htp://www.jstreack.org E-mail: spooky1...@gmail.com Do not look into waveguide with remaining eye. -- You received this message because you are subscribed to the Go