Tag: android-menu

Implementing three actions inside a single menu item in Android

I want to have similar menu item functionality as in the chrome browser for mobile as it is in the picture. I want to have back, forward, refresh menu items in a single row. How can I implement a similar menu item? is there any reference or is there is any hack to bring this […]

Vertical sliding menu in Android

Is there a vertical sliding menu available for android. I need something similar to Sliding menu of the Google Plus App BUT I need it to be able to slide vertically from bottom to top also.

How to open sub menu after click on menu-item in Navigation drawer?

I implemented a navigation drawer, with navigation view. and i am adding value in navigation view through a menu.xml file. <android.support.design.widget.NavigationView android:id=”@+id/nvView” android:layout_width=”wrap_content” android:layout_height=”match_parent” android:layout_gravity=”start” app:itemTextColor=”@android:color/white” android:background=”?attr/colorAccent” app:menu=”@menu/drawer_view” app:headerLayout=”@layout/nav_header” > </android.support.design.widget.NavigationView> every thing is working fine, but i am facing a problem, I want to display submenu’s , after click on menu. I tried many […]

Skin Options Menu Android

I’m trying to skin the options menu on android. I have the background color changed with a custom theme, but I can’t get the text color to change for some reason. My Theme <style name=”default” parent=”@android:style/Theme.NoTitleBar”> <!– Menu panel colors –> <item name=”android:panelBackground”>@color/optionsMenuBackgroundColor</item> <item name=”android:panelFullBackground”>@color/optionsMenuBackgroundColor</item> <!– Menu item colors –> <item name=”android:itemTextAppearance”>@style/OptionsMenuFont</item> </style> My Style […]

how to center icons in toolbar in android studio

I asked a similar question here… I got some tutorials in the answers. But this question is diffrenet. because none of that method do not works in my project. I want center all icons in toolbar I test all availabe ways …but always icons are floating in left. I want centering icons (I prefer left […]

Reduce Menu items width,height and textview size

I had done a menu overflow items.I need to reduce menu items width,height and textview size. I referred this post.But it is not working for me.I am posted the code and screenshot related to that: <menu xmlns:android=”http://schemas.android.com/apk/res/android” > <item android:id=”@+id/add” android:icon=”@drawable/down” android:title=”Read” android:showAsAction=”never” /> <item android:id=”@+id/add2″ android:icon=”@drawable/down” android:title=”write” android:showAsAction=”never” /> <item android:id=”@+id/add3″ android:icon=”@drawable/down” android:title=”bold” android:showAsAction=”never” […]

How to implement dynamic values on menu item in Android

I have a menu item in the action bar. Along with the menu item image, I need to show some number associated with it which will change often. I am not using Action bar sherlock. I don’t want to use that. Other than this everything else just works fine. In the shown image, the white […]

searchManager.getSearchableInfo(getComponentName()) returns null

I’ve followed this Android guide in order to add a search bar to an activity. The setup looks like this: res/menu/activity_main.xml: <?xml version=”1.0″ encoding=”utf-8″?> <menu xmlns:android=”http://schemas.android.com/apk/res/android” > <item android:id=”@+id/search” android:title=”@string/menu_search” android:icon=”@android:drawable/ic_menu_search” android:showAsAction=”collapseActionView|ifRoom” android:actionViewClass=”android.widget.SearchView” /> <item android:id=”@+id/menu_settings” android:orderInCategory=”100″ android:showAsAction=”never” android:title=”@string/menu_settings” android:icon=”@drawable/ic_menu_settings”/> </menu> res/xml/searchable.xml: <?xml version=”1.0″ encoding=”utf-8″?> <searchable xmlns:android=”http://schemas.android.com/apk/res/android” android:label=”@string/app_name” android:hint=”@string/search_hint” /> Activity entry in manifest file: […]

menu inflating calls multiple times at fragment's onCreateOptionsMenu

I use Fragments and when I switch to nested Fragment, which implements public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) my menu inflates quantity of times when I get to that nested Fragment. How can I avoid this? I also implement constructor of Fragment with methods: setRetainInstance(true); setHasOptionsMenu(true); When I tried to implement siple solution as: @Override […]

Android align menu items to left in action bar

i have action bar in my application that displays menu items defined in my res/menu/activity_main.xml My menu items are aligned to right on action bar. I want them to be aligned to left. Only solutions i found for this used custom action bar, like this one: Positioning menu items to the left of the ActionBar […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.