How do I get a copy of the Android overflow menu icon? [closed]

Can somebody please provide a link to download the overflow menu icon? http://developer.android.com Once you have downloaded the SDK, you will find your images in: $ANDROID_SDK/platforms/$PLATFORM/data/res/$DRAWABLE/ic_menu_moreoverflow* where: $ANDROID_SDK is wherever you installed your SDK $PLATFORM is some platform directory (e.g., android-17) $DRAWABLE is some major drawable directory (e.g., drawable-hdpi) There are different versions of the … Read more

How change position of popup menu on android overflow button?

To overlap only, use this approach: PopupMenu popupMenu = new PopupMenu(getContext(), this, Gravity.NO_GRAVITY, R.attr.actionOverflowMenuStyle, 0); To get a PopupMenu with a bright background and a detailed control over the offsets use this approach: styles.xml <style name=”PopupMenuOverlapAnchor” parent=”@style/Theme.AppCompat.Light”> <item name=”android:overlapAnchor”>true</item> <item name=”android:dropDownVerticalOffset”>0dp</item> <item name=”android:dropDownHorizontalOffset”>0dp</item> </style> Code: ContextThemeWrapper contextThemeWrapper = new ContextThemeWrapper(getContext(), R.style.PopupMenuOverlapAnchor); PopupMenu popupMenu = new … Read more

How to change MenuItem icon in ActionBar programmatically

You can’t use findViewById() on menu items in onCreate() because the menu layout isn’t inflated yet. You could create a global Menu variable and initialize it in the onCreateOptionsMenu() and then use it in your onClick(). private Menu menu; In your onCreateOptionsMenu() this.menu = menu; In your button’s onClick() method menu.getItem(0).setIcon(ContextCompat.getDrawable(this, R.drawable.ic_launcher));

Item with app:showAsAction not showing

Things you should always check when you want to use action bar are 1) Extend ActionBarActivity instead of Activity public class MainMenu extends ActionBarActivity{ 2) Have the right style selected as defined at manifest Manifest <application android:icon=”@drawable/ic_launcher” android:label=”@string/app_name” android:theme=”@style/AppTheme” > Style <style name=”AppTheme” parent=”Theme.AppCompat.Light.DarkActionBar”> </style> 3) Select the right title for showAsAction <menu xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:**yourapp**=”http://schemas.android.com/apk/res-auto” … Read more

Android – Correct use of invalidateOptionsMenu()

invalidateOptionsMenu() is used to say Android, that contents of menu have changed, and menu should be redrawn. For example, you click a button which adds another menu item at runtime, or hides menu items group. In this case you should call invalidateOptionsMenu(), so that the system could redraw it on UI. This method is a … Read more