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?Blackbelt– Blackbelt2014-03-11 16:14:38 +00:00Commented Mar 11, 2014 at 16:14
-
I want to write "?" to a textview with a button.Tamas Koos– Tamas Koos2014-03-11 16:16:45 +00:00Commented Mar 11, 2014 at 16:16
-
did you already wrote some code? Would you like to share it ?Blackbelt– Blackbelt2014-03-11 16:19:38 +00:00Commented Mar 11, 2014 at 16:19
-
? is allowed in strings.xmlKitAndKat– KitAndKat2014-03-11 16:20:22 +00:00Commented Mar 11, 2014 at 16:20
-
No it says "error: Error: Resource id cannot be an empty string (at 'buttonq' with value '?')."Tamas Koos– Tamas Koos2014-03-11 16:24:47 +00:00Commented Mar 11, 2014 at 16:24
|
Show 1 more comment
2 Answers
Use
<string name="question">\?</string>
to escape the question mark.
1 Comment
Tamas Koos
Thanks, it works. And how can I write a space whit another button?
Also , you can try Html.fromHtml programmatically. Following link discusses that. android-TextView setText in Html.fromHtml to display image and text
Thanks JRH