Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to have "&" i.e and symbol in Android TextView

Tags:

java

android

I want to have some simple text in textView..

Like...(android & java)

means I exactly require "and" symbol in textView

If I'm providing within TextView android:text="Bakeries & Dessert" in textView it's showing error in xml.

Can Anyone suggest me how to ignore special case characters & ," etc and have them in our TextView text.

like image 717
Arpit Garg Avatar asked May 04 '11 07:05

Arpit Garg


1 Answers

The layout files are just xml and the & symbol is not allowed by itself.

You will need to use & instead

http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Predefined_entities_in_XML

like image 59
Greg McGowan Avatar answered Sep 30 '22 15:09

Greg McGowan