0

I have buttons that write into a textview. I want to write "?", but it's not allowed in strings.xml. So, I want the button to have different value (which is written to the textview) than the text in the button. How can I do this? Thanks in advance.

6
  • what do you want to do? Commented Mar 11, 2014 at 16:14
  • I want to write "?" to a textview with a button. Commented Mar 11, 2014 at 16:16
  • did you already wrote some code? Would you like to share it ? Commented Mar 11, 2014 at 16:19
  • ? is allowed in strings.xml Commented Mar 11, 2014 at 16:20
  • No it says "error: Error: Resource id cannot be an empty string (at 'buttonq' with value '?')." Commented Mar 11, 2014 at 16:24

2 Answers 2

3

Use

<string name="question">\?</string>

to escape the question mark.

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

1 Comment

Thanks, it works. And how can I write a space whit another button?
0

Also , you can try Html.fromHtml programmatically. Following link discusses that. android-TextView setText in Html.fromHtml to display image and text

Thanks JRH

Comments

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.