I have an overflow menu in my action bar , it shown in some devices on the upper action bar and in other devices shown in the below action bar, I want to show my overflow menu on the upper action bar in all devices. Please help me.
my overflow menu :
<item
android:id="@+id/menu_overflow"
android:icon="@drawable/color"
android:orderInCategory="11111"
android:showAsAction="always">
<menu>
<item
android:id="@+id/whitecolor"
android:showAsAction="never"
android:icon="@drawable/colorwhite"
android:title="white"/>
<item
android:id="@+id/yellowcolor"
android:showAsAction="never"
android:icon="@drawable/coloryellow"
android:title="yellow"/>
<item
android:id="@+id/redcolor"
android:showAsAction="never"
android:icon="@drawable/colorred"
android:title="red"/>
<item
android:id="@+id/bluecolor"
android:showAsAction="never"
android:icon="@drawable/colorblue"
android:title="blue"/>
</menu>
</item>
and my code :
public boolean onOptionsItemSelected(MenuItem menuItem)
{
switch (menuItem.getItemId()) {
case R.id.whitecolor:
finish();
break;
case R.id.yellowcolor:
finish();
break;
case R.id.redcolor:
finish();
break;
case R.id.bluecolor:
finish();
break;
}
return true;
}