android - 元素类型 "application"后面必须跟有属性规范 ">"或 "/>"

标签 android styles themes manifest

我的代码遇到一些问题。

顺便说一句,我正在向 thenewboston 学习,目前正在学习教程 11,我在执行教程 10 时遇到了此错误,在解决此问题之前我不打算继续学习下一个教程。

 <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.thenewboston.sammy"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="17" />

    <application android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"

它说: 元素类型“application”后面必须跟有属性规范“">”或“/>”。

        <activity android:name="com.thenewboston.sammy.StartingPoint"
            android:label="@string/app_name" 
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

最佳答案

字符串资源中不能有空格。我会将 @string/Your Total is 0 更改为 @string/total_is_zero,然后在 strings.xml 中创建该字符串资源:

res/values/strings.xml 创建此:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="total_is_zero">Your total is 0</string>
</resources>

关于android - 元素类型 "application"后面必须跟有属性规范 ">"或 "/>",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17201712/

相关文章:

android - 小部件没有响应

使用 OpenSSL 的 libcurl 的 Android-21 静态构建

themes - 我正在为 tumblr 构建主题,但 {HasPages} 似乎无法正常工作

eclipse - 如何更改 Eclipse 项目资源管理器的背景颜色?

android - SQLite 数据库 : Create multiple tables dynamically at runtime?

android - 尝试添加 menu.xml 时 Eclipse 挂起

css - 如何在大html元素(div)中根据每个html元素(div)的宽度自由打包、排列自己?

android - 更改 appcompat 的 SearchView 文本和提示颜色

css - HTML 获取两个 div 并排对齐,并且在调整浏览器大小时不换行

android - 以编程方式为Android手机选择主题