creating an options menu with quit application function
<p>I'm writing an application for android and I would like to insert an options menu, that would have only one function and that is to quit an application.</p>

<p>My options_menu.xml looks like this (I created a new folder under res called menu - just like the instructions said):</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;menu xmlns:android="http://schemas.android.com/apk/res/android"&gt;
    &lt;item android:id="@+id/quit"
          android:icon="@drawable/ic_quit"
          android:title="@string/quit" /&gt;          
&lt;/menu&gt;
</code></pre>

<p>Than I added the following code to my java class file:</p>

<pre><code>@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.options_menu, menu);
    return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    // Handle item selection
    switch (item.getItemId()) {
    case R.id.quit:
        finish();
        return true;
    default:
        return super.onOptionsItemSelected(item);
    }
}
</code></pre>

<p>I also defined the @string/quit in values - strings.xml file, but it still says that there is an error:</p>

<pre><code>C:\Users\Domen\workspace\Lovne Dobe1.1\res\menu\options_menu.xml:3: error: Error: No resource found that matches the given name (at 'title' with value '@string/quit')
</code></pre>

<p>So if anybody can help I would be very grateful.</p>
