Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set button text to question mark

Tags:

I need to set a button's text to just ?.
I'm happy to do it via Java, but would rather do it via the XML.
Is it possible?

I've tried android:text="?" and android:text="?" but it did not work.
Then I set one of the string resources to ?, and when that did not work I set it to ?referenced that but it doesn't work!

How do I set the button caption to ? using XML?

like image 618
Person Avatar asked Sep 06 '11 10:09

Person


2 Answers

You need to escape the question mark...

android:text="\?"
like image 62
IncrediApp Avatar answered Sep 20 '22 19:09

IncrediApp


Write "\?" Intead normal or ASCII form.

like image 2
Zwiebel Avatar answered Sep 20 '22 19:09

Zwiebel