2

I can not find what is wrong with the main.xml file

here is the main code:

<menu xmlns:android="http://schemas.android.com/apk/res/android" >

    <item

        android:id="@+id/action_settings"
        android:orderInCategory="100"
        android:showAsAction="never"
        android:title="@string/action_settings"/>

</menu>

The error i face is:

Error: No resource found that matches the given name (at 'title' with value '@string/action_settings').

Thanks

2
  • 2
    check whether you have string action_settings defined in strings.xml May 6, 2013 at 7:42
  • 1
    In string.xml file you have done spelling mistake. so may be resource no found with '@string/action_settings' :)
    – Mit Bhatt
    May 6, 2013 at 7:44

3 Answers 3

7

Please check your res/values/strings.xml and have a look if there is <string name="action_settings"></string> value.

0

SOLVED:

add in ..\res\values\strings.xml

<string name="action_settings">Action Settings</string>

And Update ..\src\com\example\helloworld\MainActivity.java Line 18 with follows

getMenuInflater().inflate(R.menu.main, menu);

it worked for me.

thanks

0

i think you need to build & refresh your project because maybe the id action_setting is not visible to the R.java file. i have the same error shown but my code was missing + between @ and id

<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context="com.amrismail.logintutorial.Main" >
    <item
    android:id=@id/action_settings"
    android:orderInCategory="100"
    android:showAsAction="never"
    android:title="@string/action_settings"/>

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.