Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
Is it possible to set text of textview in xml from string array? (like android:text="@string/title[3]" if I want to set the third item) Or I have to do it programatically?
Thanks in advance.
textview.setText(title[3])
Unfortunately you cannot access in layout xml file.
But you can do it in java
String[] some_array = getResources().getStringArray(R.array.your_string_array); textView.setText(some_array[5]);
Add a comment
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.
textview.setText(title[3])