【发布时间】:2016-03-31 15:04:20
【问题描述】:
我在 strings.xml 中有一个字符串,它应该显示在密码字段下方,显示哪些字符不能使用。
字符串是:
<string name="password_invalid">The key can only consist of 8 to 63 ASCII characters or 64 hexdecimal digits bestehen und cannot contain these characters: \" , : ; \\ & % + ' < > ?</string>
但每次我运行代码时,我都会从 Android Studio 收到一条错误消息:
Error:(495) Apostrophe not preceded by \ (in The key can only consist of 8 to 63 ASCII characters or 64 hexdecimal digits bestehen und cannot contain these characters: \" , : ; \\ & % + ' < > ?)
我只是不明白为什么 Android Studio 将双引号视为错误,我已经在它前面加上了一个反斜杠,正如 documentation 所说的那样。 我做了什么:
- 重新输入整个短语,而不是从某个地方复制它 -> 相同的错误
- 用
&quot;代替 \" 写双引号 -> 不显示 - 清理/重建应用程序 -> 相同的错误
我要么从上面得到错误消息,要么双引号被完全忽略。有谁知道为什么它不起作用?
【问题讨论】:
-
我从
RecyclerView适配器访问它以将其设置为TextView的文本