我的代码遇到一些问题。
顺便说一句,我正在向 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/