我是新來的android開發,並正在讀它的書(開始android 4開發),同時創建hello世界我陷入了一些錯誤,首先我解決了他們,但我的應用程序是強制關閉所以我複製粘貼的所有事情,並得到了4個錯誤: -錯誤在你好世界xml
Multiple annotations found at this line: - Attribute is missing the Android namespace prefix - Suspicious namespace: should start with http:// - Open quote is expected for attribute "xmlns:android" associated with an element type "LinearLayout". - error: Error parsing XML: not well-formed (invalid token)
Unexpected namespace prefix "android" found for tag TextView
Multiple annotations found at this line: - Unexpected namespace prefix "android" found for tag TextView - Attribute is missing the Android namespace prefix
Unexpected namespace prefix "android" found for tag Button
代碼示例
<?xml version ="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android=」http://schemas.android.com/apk/res/ android」
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_orientation="vertical"
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />
<TextView
android:layout_width=」fill_parent」
android:layout_height=」wrap_content」
android:text=」@string/This is my first Android Application!」 />
<Button
android:layout_width="fill_parent"
android:layout_width="wrap_content"
android:text="@string/And this is clickable :D" />
我不認爲有一個在代碼中的任何錯誤:/
是上述xml相同,在書中,我真的懷疑這一點。 – Thalaivar