Create an Overflow menu inside Activity and Fragment.
That is all. If any help related to this post please comment.
Thank you, guys.
Enjoy coding.
@SuppressLint("RestrictedApi")
@Override
public boolean onCreateOptionsMenu(Menu menu) {
menu.clear();
getMenuInflater().inflate(R.menu.all_page_menu, menu);
if(menu instanceof MenuBuilder) {
MenuBuilder m = (MenuBuilder) menu;
m.setOptionalIconsVisible(true);
}
return true;
}
From this Link.
OR
Create a menu like this. Here ic_more_vert is 3 dot image.
<?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"> <item android:id="@+id/none" android:icon="@drawable/ic_more_vert" android:title="" app:showAsAction="always"> <menu> <item android:id="@+id/home" android:icon="@drawable/home" android:title="HOME" /> </menu> </item> <item android:id="@+id/add" android:icon="@drawable/plus_white" android:orderInCategory="100" android:title="Add" app:showAsAction="always" /> </menu>
Thank you, guys.
Enjoy coding.
No comments:
Post a Comment