2

When giving a String array to a spinner, is it better to do it in the xml or programitically? My array has about 50 strings, and spinner will not change its array contents.

2 Answers 2

2

If the spinner always show the same values, use XML. This will make it easier for you to manage the strings, and possibly add translations for them in a later stage.

Sign up to request clarification or add additional context in comments.

Comments

0

Assuming you want to change the contents of the array dynamically, a programmatic approach is the best option.

See a description of the programmatic approach here.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.