I want to be able to show the free-dot menu always without using ActionBar. Just 3 dots menu + items in it, that's it. How can I do that? Here's my code
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".MyMainActivity">
<item
android:id="@+id/empty"
android:showAsAction="always"
android:title="@string/dot_menu"
android:icon="@android:drawable/ic_menu_more">
<menu>
<item
android:id="@+id/item1"
android:showAsAction="ifRoom"
android:title="@string/item1" />
<item
android:id="@+id/item2"
android:showAsAction="ifRoom"
android:title="@string/item2" />
<!-- ........... -->
And:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
//.....
}
It doesn't show a menu at all.