2013-02-19 77 views
0

由於我是Android新手,我試圖在我的strings.xml文件中添加一個新字符串後,遇到了一個似乎很常見的新手問題(XML文件中的錯誤:中止構建)。我在哪裏可以找到Android應用程序的out.xml文件?

我搜索了網頁,許多開發人員(實際上,大多數)建議我應該刪除blabla.out.xml。我知道這可能聽起來很愚蠢(或者說是愚蠢的,你的調用),但是我確實在查找out.xml文件時遇到了問題。要麼我的問題與其他人的問題(我懷疑)沒有相同的性質,但我找不到我的out.xml文件。

如果您可以指示我在哪裏可以找到它,或者如果您可以指示我另一個很棒的解決方案。

預先感謝您。

編輯:

我activity_main.xml中的文件:

 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:paddingBottom="@dimen/activity_vertical_margin" 
android:paddingLeft="@dimen/activity_horizontal_margin" 
android:paddingRight="@dimen/activity_horizontal_margin" 
android:paddingTop="@dimen/activity_vertical_margin" 
android:orientation="horizontal" 
tools:context=".MainActivity" > 

<EditText> 
    android:id="@+id/edit_message" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:hint="@string/edit_message" 
</EditText> 

在strings.xml中,我想這個名字edit_message爲了顯示在初始消息添加一個字符串我文本框(EditBox)

+0

發表您的佈局XML文件的內容,以確保有沒有一個真正的問題用它。 out.xml文件將與原始xml文件位於同一個目錄中。 – 2013-02-19 14:23:40

+0

找。 -name「* out.xml」? – njzk2 2013-02-19 14:30:34

+0

out.xml文件不在那裏:)。我仍然無法弄清楚問題所在: - ? – SunnyDay 2013-02-19 14:40:04

回答

1

我建議您閱讀本指南:String Resources

您需要了解Android項目文件夾層次結構。
看一下Eclipse:你的項目名稱> res> values> strings.xml。 它應該是這樣的:

<?xml version="1.0" encoding="utf-8"?> 
<resources> 

    <string name="hello">Hello World!</string> 
    <string name="app_name">Hello Android</string> 

</resources> 

編輯:您需要添加edit_messagestrings.xml

<?xml version="1.0" encoding="utf-8"?> 
    <resources> 

     <string name="hello">Hello World!</string> 
     <string name="app_name">Hello Android</string> 
     <string name="edit_message">Your message</string> 

    </resources> 
+0

我的strings.xml文件看起來像這樣:'<?XML版本= 「1.0」 編碼= 「UTF-8」> <字符串名稱= 「APP_NAME」> MyFirstApp <字符串名稱= 「action_settings」>設置 Hello world! 輸入一條消息 ' – SunnyDay 2013-02-19 14:34:30

+0

它被添加(這是最後一個) – SunnyDay 2013-02-19 14:44:05

+0

您是否試過清理您的項目? Eclipse> Project> Clean – EvZ 2013-02-19 14:47:00

相關問題