Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
299 views
in Technique[技术] by (71.8m points)

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

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...