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

Apps String arrays are saving as int arrays

nickf77

Newbie
It's probably something stupid that I'm overlooking, but nevertheless it's frustrating (and confusing) the crap outta me.

I declared a string-array in my res/values/strings.xml file, but when I try to reference it in code, it says it's of type 'int' and can't be converted to a string. R.java also has it listed as an integer array. The thing is, in my XML it's declared as <string-array>, not <integer-array>. Any suggestions?
 
Never mind - it WAS something stupid that I was overlooking....

I was using
Code:
R.array.<myArray>
which returns an integer. Changed it to
Code:
getResources().getStringArray(R.array.<myArray>)

Problem solved. And now I feel like an idiot. :o
 
Back
Top Bottom