因此,我試圖使用Eclipse來跟隨Android的「構建單一用戶界面」教程,但是我收到兩個讓我的代碼無法運行的錯誤。Android「構建一個簡單的用戶界面」教程中的錯誤
第一個錯誤是在res /菜單/ main.xml中的廣告說:
error: Error: No resource found that matches the given name (at 'title' with value '@string/ action_settings').
那是給我的錯誤代碼行是:
android:title="@string/action_settings"/>
我的第二個錯誤是在RES /價值/ strings.xml中說:
error: Found tag String where item is expected
爲線
<String name="menu_settings">Settings</String>
整個「String.xml」文件如下:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">My First App</string>
<string name="edit_message">Enter a message</string>
<string name="button_send">Send</string>
<String name="menu_settings">Settings</String>
<String name ="title_activity_main">MainActivity</String>
<String name ="action_settings">Settings</String>
</resources>
雖然我在使用Java/Eclipse的經歷我,我是新來的Android和XML,所以我完全不知道這些錯誤意味着什麼。任何幫助你可以提供將不勝感激!