Android string.xml error: Apostrophe not preceded by \

遇到了这个错误,编译无法通过 error: Apostrophe not preceded by \

错误的代码是:

   <string name="security_protocol_dialog_content_1_msg">Restoring factory settings, the system will erase the phone's data without warning.</string>

正确的代码是:

   <string name="security_protocol_dialog_content_1_msg">Restoring factory settings, the system will erase the phone\'s data without warning.</string>

额外加了一个转义字符(\)

当字符串中包含单引号(')的时候,就需要转义字符进行转义。

XML中的特殊字符:

单引号   '      '
双引号 " "
大于号 > >
小于号 < <
与 & &

  

Android string.xml error: Apostrophe not preceded by \的更多相关文章

  1. 关于 Android项目“error: Apostrophe not preceded by \ (”的解决方法

    用Eclipse环境开发Android项目,如果编译时控制台报出“error: Apostrophe not preceded by \ (”这种错误,那么多半是因为项目中的一个strings.xml ...

  2. 我的Android进阶之旅------&gt;Android字符串资源中的单引號问题error: Apostrophe not preceded by 的解决的方法

    刚刚在string字符串资源文件里,写了一个单引號.报错了,错误代码例如以下 error: Apostrophe not preceded by \ (in OuyangPeng's blog ) 资 ...

  3. 我的Android进阶之旅------>Android字符串资源中的单引号问题error: Apostrophe not preceded by 的解决办法

    刚刚在string字符串资源文件中,写了一个单引号,报错了,错误代码如下 error: Apostrophe not preceded by \ (in OuyangPeng's blog ) 资源文 ...

  4. 我的Android进阶之旅------>报 error: Apostrophe not preceded by \ 的错误解决办法

    今天对项目进行国际化翻译的时候控制台出现了以下的错误: res/values/strings.xml:100: error: Apostrophe not preceded by \ (in Sorr ...

  5. 【Android】android string.xml前后加空格的技巧

    android string.xml 文字中间加入空格 <string name="password">密    码</string> &#160 ...

  6. android string.xml %问题

    反复检查后发现是string.xml中的 % 导致编译失败, 这是由于新的SDK采用了新版本的aapt(Android项目编译器),这个版本的aapt编译起来会比老版本更加的严格,然后在Android ...

  7. error: Apostrophe not preceded by \

    解决方案为:在编译出错提示中找到相关的string.xml文档,在string标签中的字符串含有单引号(')前面,加上反斜杠(\)转义即可.

  8. android string.xml里的空格字符

    在string.xml定义字符串的时候常常要用到空格, 直接用键盘敲的话不知道是几个空格,常常看错了,导致误删. 假设用 来替代空格的话,就好非常多. 另外使用%1$s,%1$d能够在一个字符串里定义 ...

  9. Android string.xml 添加特殊字符

    解决项目中在string.xml 中显示特殊符号的问题,如@号冒号等.只能考虑使用ASCII码进行显示: @号 @ :号 : 空格   以下为常见的ASCII十进制交换编码: --> <- ...

随机推荐

  1. QQwry

    http://blog.runphp.net/archives/156 http://wenku.baidu.com/link?url=yvd3_EpMM66r6H4qkx3oqcaU2JZNAQv_ ...

  2. Linux批量重命名文件

    五种方法实现Linux批量重命名文件 Linux批量重命名文件是指对某些特定的文件统一进行重新命名,以改变原来一批文件的名称,这里介绍五种方法来实现. Linux批量重命名文件会涉及到改变一个字母.改 ...

  3. find the most comfortable road(并差集,找差值最小的权值)

    find the most comfortable road Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K ...

  4. Java控制台输入ScannerDemo

  5. Python读取Excel数据并根据列名取值

    一直想将自己接触到的东西梳理一遍,可就是迈不出第一步,希望从这篇总结开始不要再做行动的矮人了. 最近测试过程中需要用到python读取excel用例数据,于是去了解和学习了下xlrd库,这里只记录使用 ...

  6. [LeetCode]题解(python):013-Roman to Integer

    题目来源: https://leetcode.com/problems/roman-to-integer/ 题意分析: 这道题目和上一题目相反,是将罗马数字转化成阿拉伯数字. 题目思路: 只要知道罗马 ...

  7. phpeclipse

    http://phpeclipse.sourceforge.net/update/stable/1.2.x/

  8. 挺有意思的HBase日志+Splunk

    如题,转载自: http://hi.baidu.com/harry_lime/item/10cf2c174853c7ea39cb3042 如何模拟拔盘操作 Linux has a nifty way ...

  9. QStringLiteral的两篇外文解释(编译期转换成QString)

    http://blog.qt.io/blog/2014/06/13/qt-weekly-13-qstringliteral/ https://woboq.com/blog/qstringliteral ...

  10. java如何把char型数据转换成int型数据(转)

    一字符串,String=“2324234535”:把第i个数取出来时是char型的:char temp=String.charAt(i)如何把char型转换成int型?我需要求个尾数之和,如:123的 ...