Android中的strings.xml文件出错 [英] Error in strings.xml file in Android
本文介绍了Android中的strings.xml文件出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经在应用程序的 string.xml
中声明了一个长字符串。
I have declared a long string in string.xml
of an application.
这样声明
Declared like this
<string name="terms">PLEASE READ THESE TERMS OF USE CAREFULLY BY ACCESSING THIS .................</string>
但这会给出以下错误:
error: Apostrophe not preceded by \ (in PLEASE READ THESE TERMS OF USE CAREFULLY
推荐答案
发布你的完整的字符串虽然我的猜测是在字符串中有一个撇号(')字符,用(\')替换,它会修复这个问题,例如
post your complete string. Though, my guess is there is an apostrophe (') character in your string. replace it with (\') and it will fix the issue. for example,
//strings.xml
<string name="terms">
Hey Mr. Android, are you stuck? Here, I\'ll clear a path for you.
</string>
参考:
http://www.mrexcel.com/forum/showthread.php?t=195353
< a href =http://code.google.com/p/replicaisland/issues/detail?id=48 =noreferrer> http://code.google.com/p/replicaisland/issues/detail? id = 48
这篇关于Android中的strings.xml文件出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文