• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps String Arrays and Resources

Hi Everyone,

I am using a string array I placed in the /res/strings.xml file and I want to use the elements in the array to display to screen. So I tried this:

int index = 1;
TextView t = (TextView) findViewById(R.id.lblSetup);
t.setText("Setup Preference: " + R.array.myArray[index]);

But the syntax in line 3 is not valid. How can I index into my array to display that element onscreen?

Thanks,
Billius
 
Back
Top Bottom