Preamble
As usual, I ran into some strange problem while developing an application for Android, tried to find a solution and landed on this question. As it was in many cases before, there is no answer. Therefore, I was forced to solve the problem from scratch and now posted an answer with my workaround.
Enter
I have an Android application with an action bar and some menu items that need to be expanded using a submenu of the drop-down list. The first attempt was to implement it, as suggested in the documentation for Android. Therefore, I added a new menu item menu_sort to the existing action bar menu and the menu container:
<menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/id1" android:icon="@drawable/ic_1" android:title="@string/id1" android:showAsAction="withText|always"/> ... <item android:id="@+id/menu_sort" android:icon="@drawable/ic_menu_sort_selector" android:title="▾" android:titleCondensed="▾" android:showAsAction="withText|always"> <menu> <item android:id="@+id/menu_sort_by_name" android:showAsAction="never" android:checkable="true" android:checked="true" android:title="@string/sort_by_name"/> <item android:id="@+id/menu_sort_by_priority" android:showAsAction="never" android:checkable="true" android:checked="false" android:title="@string/sort_by_priority"/> <item android:id="@+id/menu_sort_by_memory" android:showAsAction="never" android:checkable="true" android:checked="false" android:title="@string/sort_by_memory"/> </menu> </item> </menu>
Result
The effect was exactly as described in the question: the submenu is displayed on top of the action bar. Here is a screenshot taken on Android 5.1.1:

I played with many options and code snippets - nothing helped. Finally, I came to the next
Decision
First, move all the submenus to a separate menu layout, for example menu/sorting.xml , and remove it from the menu_sort item of the main menu (shown above).
Secondly, modify or create an onPrepareOptionsMenu event onPrepareOptionsMenu with the following code:
@Override public boolean onPrepareOptionsMenu(Menu menu) { // as solution utilizes PopupMenu, // take care about older Android versions if necessry // if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) // here goes most crazy part: we use menu id // to retrieve corresponding view, automatically created by OS; // imho, this is a hack, and menu item should have getView() method or similar; View menuItemView = findViewById(R.id.menu_sort); // by the way, menuItemView could probably be null under some circumstances // create a popup anchored to the view (menu item) final PopupMenu popupMenu = new PopupMenu(this, menuItemView); // API 14 // popupMenu.inflate(R.menu.sorting); // API 11 (HONEYCOMB) popupMenu.getMenuInflater().inflate(R.menu.sorting, popupMenu.getMenu()); // process popup clicks as appropriate popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { switch(item.getItemId()) { // ... place some code } return true; } }); // bind the popup to the item menu menu.findItem(R.id.menu_sort).setOnMenuItemClickListener(new OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { popupMenu.show(); return true; } }); return super.onPrepareOptionsMenu(menu); }
Here is the result:

Now the drop-down menu is displayed from the very beginning from the very beginning.