dポイントプレゼントキャンペーン実施中!

自分は今、本を読みながらandroidプログラミングの勉強をしています。
XMLファイルをよく見直して間違いは見当たらないのですが
起動しようとすると「your project contains error」と表示されます。
コンソールには「No resource found that matches the given name (at 'title' with value '@string/menu_settings')」と書いてあります。
ネットで調べたらソースをクリーンすればいいと書いてありましたが
クリーンすると今度はjavaファイルにエラーが起きます。

以下が自分が打ち込んだXMLのソースコードです。

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<TextView android:text="お申込みフォーム"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:text="お名前 :"
android:layout_width="70sp"
android:layout_height="wrap_content"/>
<EditText
android:id="@+id/name"
android:layout_width="200dp"
android:layout_height="wrap_content"/>
</LinearLayout>

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:text="住所 :"
android:layout_width="70sp"
android:layout_height="wrap_content"/>
<EditText
android:id="@+id/address"
android:layout_width="200dp"
android:layout_height="wrap_content"/>
</LinearLayout>

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:text="生年月日 :"
android:layout_width="70sp"
android:layout_height="wrap_content"/>
<Spinner
android:id="@+id/month"
android:entries="@array/month"
android:layout_width="85dp"
android:layout_height="wrap_content"/>
<TextView
android:text="月"
android:layout_width="20sp"
android:layout_height="wrap_content"/>
<Spinner
android:id="@+id/day"
android:entries="@array/day"
android:layout_width="85dp"
android:layout_height="wrap_content"/>
<TextView
android:text="日"
android:layout_width="20sp"
android:layout_height="wrap_content"/>
</LinearLayout>

</LinearLayout>

どうかよろしくお願い致します。

A 回答 (2件)

No.1です。


それをそのまま書いてもダメです。
strings.xmlとは何を書くものなのか、お持ちの本をご確認ください。

この回答への補足

度々すいません。
本を読んだのですがよくわかりませんでした。
ネット上で調べたりして色々試したりもしました。
どう書き込んだらいいか教えていただけませんでしょうか。

補足日時:2012/09/11 21:48
    • good
    • 0
この回答へのお礼

すいません。
もっとよく調べたら解決できました。
やっとプログラムが起動しました。
とても参考になりました。
ありがとうございます。

お礼日時:2012/09/12 13:21

出力されてる、


No resource found that matches the given name (at 'title' with value '@string/menu_settings')
の意味はお分かりですか?
strings.xmlにmenu_settingsが記述されていますか?

お書きになったXMLにはないようなので、別ファイルで記述されているかもしれませんが。。。

この回答への補足

menuフォルダの中に

<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/menu_settings"
android:title="@string/menu_settings"
android:orderInCategory="100" />
</menu>
という記述がありました。
この記述をstring.xmlに加えればいいのでしょうか?

補足日時:2012/09/09 12:36
    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!