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. libcprops

    Install Howto Download the latest epel-release rpm from http://dl.fedoraproject.org/pub/epel/6/x86_6 ...

  2. MVC-03 控制器(5)

    八.动作过滤器 有时在运行Action之前或之后会需要运行一些逻辑运算,以及处理一些运行过程中所生成的异常状况,为了满足这个需求,ASP.NET MVC提供动作过滤器(Action Filter)来处 ...

  3. C# 读书笔记之访问关键字this和base

    this 关键字引用类的当前实例.静态成员方法中不能使用this关键字,this关键字只能在实例构造函数.实例方法或实例访问器中使用. base 关键字用于从派生类中访问基类的成员. 指定创建派生类实 ...

  4. Windows下Python中的中文路径和中文输出问题

    这几天有个项目需要写一点类似于脚本的小程序,就用Python写了,涉及到中文路径和中文输出的问题,整理一下. 有一个问题我觉得需要先强调一下,在写Python程序的时候,一定保证编码是utf-8,然后 ...

  5. TCP/IP笔记 三.运输层(3)——TCP超时重传算法

    TCP 每发送一个报文段,就对这个报文段设置一次计时器.只要计时器设置的重传时间到但还没有收到确认,就要重传这一报文段 1. 平均往返时延RTT 往返时延:一个报文段发出的时间,以及收到相应的确认报文 ...

  6. JAVA GUI学习 - JDialog模式、非模式窗口组件学习

    /** * JDilog学习笔记 * @author Wfei * */ public class JDialogKnow extends JFrame { JDialog jDialog; JBut ...

  7. [置顶] perl脚本中defined,exists和delete关键字的用法和区别

    刚学习perl脚本的时候,喜欢频繁使用defined关键字判断一个hash中某个key是否存在,后来程序出了问题才去perl官方文档查看关于defined关键字的准确使用方法.因此,这里我把perl中 ...

  8. View中的onTouchEvent()与setOnTouchListener()中的ontouch()方法的事件处理先后顺序

    Touch事件的两种情况 1.覆写View.class中定义的onTouchEvent-->基于事件回调监听方式 @Override public boolean onTouchEvent(Mo ...

  9. UILabel显示html文本

    NSString * htmlString = @"<html><body> Some html string \n <font size=\"13\ ...

  10. D - D 田忌赛马

    D - D    田忌赛马   解题报告 hdu 1052 Tian Ji -- The Horse Racing 链接:http://acm.hust.edu.cn/vjudge/contest/v ...