Opening a ContextMenu with an ImageButton
<p>For some reason I can't create a context menu. </p>

<p>I have these lines in onCreate:</p>

<pre><code>btnMenu = (ImageButton) findViewById(R.id.btnMenu);

registerForContextMenu(btnMenu);
</code></pre>

<p>And added the method:</p>

<pre><code>@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.mainmenu, menu);
}
</code></pre>

<p>I have an xml file in res/menu called mainmenu:</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/new_game"
    android:title="item1"
    /&gt;
    &lt;item android:id="@+id/help"
    android:title="item2" 
    /&gt;

&lt;/menu&gt;
</code></pre>

<p>But when I click the imagebutton nothing appears.</p>

<p>Any help is appreciated.</p>
