How to write character & in android strings.xml

Palo picture Palo · Jun 16, 2010 · Viewed 279.8k times · Source

I wrote the following in the strings.xml file:

<string name="game_settings_dragNDropMove_checkBox">Move by Drag&Drop</string>

I got the following error:

The reference to entity "Drop" must end with the ';' delimiter.

How can I write character & in the strings.xml?

Answer

Bob Fincheimer picture Bob Fincheimer · Jun 16, 2010

Encode it:

&amp;