刚开始学android,照着书下例子做出现异常,不懂,代码贴出来高手指教上
刚开始学android,照着书上例子做出现错误,不懂,代码贴出来高手指教下
建了个工程叫helloandroid。res里面的layout文件代码如下
调试后出现这样的错误:[2012-12-03 19:54:13 - helloandroid] G:\JAVA\myeclipse源文件\helloandroid\res\menu\activity_main.xml:3: error: Error: No resource found that matches the given name (at 'title' with value '@string/menu_settings').
我大概能够看到好像是一个menu文件夹下的activity_main.xml文件不对劲。又不知道怎么搞,高手指点一下这是什么文件,怎么设置?这是我menu下的代码:
建了个工程叫helloandroid。res里面的layout文件代码如下
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="161dp"
android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/activity_main_title"/>
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/continue_lable"/>
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/new_game_lable"/>
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/about_lable"/>
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/exit_lable"/>
</LinearLayout>
调试后出现这样的错误:[2012-12-03 19:54:13 - helloandroid] G:\JAVA\myeclipse源文件\helloandroid\res\menu\activity_main.xml:3: error: Error: No resource found that matches the given name (at 'title' with value '@string/menu_settings').
我大概能够看到好像是一个menu文件夹下的activity_main.xml文件不对劲。又不知道怎么搞,高手指点一下这是什么文件,怎么设置?这是我menu下的代码:
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/menu_settings"