1

I'm not sure but is it possible to set text in android from a custom xml or html?

example: I have text.xml or text.html which contains

<item>
<id>1</id>
<question>how r u?</question>
<answer>fine</answer>
<answer right>good</answer>
<answer>bad</answer>
<answer>not in mood</answer>
</item>

now in my activity, I have 5 textviews. the first one gets to set as the qustions so it will be"how r u?" .. and the other four will be "fine", "good", "bad", and "not in mood". Now when I click on "good" because in the file it was <answer right> so I get to another activity using intent and when I click on rest of answers they take me to another specific activity too.

1 Answer 1

1

You need the XmlParser to parse the xml files and set the text in the TextView

Check this link

Parsing XML Data

Parsing XML Using DOM Parser from Assets

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

2 Comments

yes it is..check the link that i've provided..it has the example.
Umm this link takes from the net .. I'm looking for an xml which is in the project it self, same method?

Your Answer

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.

Ask question

Explore related questions

See similar questions with these tags.