getItemId function returns huge numbers - action bar buttons <p>I am trying to add submenus , I created xml:</p> <pre><code> &lt;menu xmlns:android="http://schemas.android.com/apk/res/android" &gt; &lt;item android:id="@+id/action_overflow" android:icon="@drawable/ic_action_overflow" android:showAsAction="ifRoom" android:title="@string/action_overflow"&gt; &lt;menu&gt; &lt;item android:id="@+id/item1" android:title="test"&gt;&lt;/item&gt; &lt;item android:id="@+id/item2" android:title="test2"&gt;&lt;/item&gt; &lt;item android:id="@+id/item3" android:title="test3"&gt;&lt;/item&gt; </code></pre> <p> </p> <p></p> <pre><code>&lt;/menu&gt;&lt;/item&gt;&lt;/menu&gt; </code></pre> <p>in mainactivity.java:</p> <pre><code> @Override public boolean onOptionsItemSelected(MenuItem item) { // int menuid = item.getItemId(); Toast.makeText(MainActivity.this, "id: "+item.getItemId(), Toast.LENGTH_SHORT).show(); return true; } </code></pre> <p>it shows me numbers like 2131034200...... etc..</p> <p>please help :(</p>