android-menu

Android Split Action Bar with Action Items on the top and bottom?

喜你入骨 提交于 2019-11-26 19:37:50
Is there a way to specify some action items to the top part of the Split Action Bar while the others go to the bottom? Or is it all or nothing, whereby all the action items go to the bottom part of the split only? This is currently not possible. See the response directly from Android developers Reto Meier and Roman Nurik during the Android Developer Office Hours: http://youtu.be/pBmRCBP56-Q?t=55m50s To solve this I used a custom view as my action bar: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); ActionBar

dynamic adding item to NavigationView in Android

[亡魂溺海] 提交于 2019-11-26 19:37:38
问题 I want to build NavigationDrawer with the possibility of adding new items (such as yahoo weather App with adding new cities). I have working NavigationDrawer with NavigationView , in menu I have permanent fields: <group android:id="@+id/group" android:checkableBehavior="single"> <item android:checked="false" android:id="@+id/item1" android:icon="@drawable/ic_inbox_black_24dp" android:title="Item1" /> <item android:checked="false" android:id="@+id/Item2" android:icon="@drawable/ic_inbox_black

PopupWindow - Dismiss when clicked outside

独自空忆成欢 提交于 2019-11-26 17:23:13
I have a PopupWindow on my activity, the thing is my PopupWindow still shows even when I'm interacting with my activity (say scrolling on my list). I can scroll through my list and the PopupWindow is still there. What I want to achieve is when I'm touching/scrolling/clicking/etc on the screen which is not the PopupWindow, I want to dismiss the PopupWindow. Just like how a menu works. If you clicked outside of the menu, the menu will be dismissed. I've tried setOutsideTouchable(true) but it won't dismiss the window. Thanks. Marcin S. Please try to set setBackgroundDrawable on PopupWindow that

openOptionsMenu function not working in ICS?

落爺英雄遲暮 提交于 2019-11-26 17:11:25
问题 Im using action bar compability library. Im trying to open the options menu from a button with openOptionsMenu() function but it does nothing. Menu shows as usual when pressing the menu key on my phone. What is wrong here? public class ReadActivity extends ActionBarActivity { ... @Override public boolean onCreateOptionsMenu(Menu menu) { boolean value; MenuInflater menuInflater = getMenuInflater(); menuInflater.inflate(R.menu.read, menu); value = super.onCreateOptionsMenu(menu); if (Helper

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

﹥>﹥吖頭↗ 提交于 2019-11-26 16:34:07
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . How do I get a copy of Android's overflow menu icon to use in a custom menu. 回答1: 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

How to change option menu icon in the action bar?

≯℡__Kan透↙ 提交于 2019-11-26 12:39:21
问题 How to change the index icon of option menu? I mean icon (3). Here is my code: @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.options, menu); return true; } And here is the XML file: <item android:id=\"@+id/Bugreport\" android:title=\"@string/option_bugreport\" /> <item android:id=\"@+id/Info\" android:title=\"@string/option_info\" /> <item android:id=\"@+id/About\" android:title=\"@string/option_about\" /> 回答1: The

How To show icons in Overflow menu in ActionBar

╄→尐↘猪︶ㄣ 提交于 2019-11-26 12:12:33
I know it's not possible using the native API. Is there a workaround to implement that kind of view? The previously posted answer is OK, generally speaking. But it basically removes the default behaviour of the Overflow menu. Things like how many icons can be displayed on different screen-sizes and then they dropped off into the overflow menu when they can't be displayed. By doing the above you remove a lot of important functionality. A better method would be to tell the overflow menu to display the icons directly. You can do this by adding the following code to your Activity. @Override public

actionlayout on menuitem does nothing

你。 提交于 2019-11-26 10:56:57
问题 i am setting an actionLayout on a menu item and setting background color and image, but it\'s not respected. in my activity, i have: getMenuInflater().inflate(R.menu.submit_action, menu); my submit_action is: <menu xmlns:android=\"http://schemas.android.com/apk/res/android\" xmlns:app=\"http://schemas.android.com/apk/res-auto\"> <item android:id=\"@+id/action_submit\" android:actionLayout=\"@layout/check\" app:showAsAction=\"always\" /> </menu> my check layout is <RelativeLayout xmlns:android

“No resource identifier found for attribute &#39;showAsAction&#39; in package &#39;android&#39;”

不想你离开。 提交于 2019-11-26 09:37:06
问题 I am attempting to update my android application to look better for tablets running Honeycomb. As such, I am targeting version 11 of the SDK (my minSdkVersion = 4). This adds the Honeycomb theme to my app, making it look better. However, I have no way to access my menu options. So, I am attempting to add my menu items as an action bar item with the following in the file in my /res/menu/ folder: android:showAsAction=\"ifRoom|withText\" However, I get the following error: No resource identifier

Android: customize application&#39;s menu (e.g background color)

孤街醉人 提交于 2019-11-26 08:36:58
What is the way (if there is a way) to customize the menu (the one triggered by the MENU button of the phone). I'm especially interested in two things: changing the background color from the standard light gray into a darker gray how the menu items are aligned. I have 4 items and they are automatically aligned 2x2, but I would prefer to have them all in one line (1x4) Not with the built-in menu framework. You are welcome to intercept the MENU button (via onKeyDown() or something) and render what you want, but bear in mind that users will be expecting it to look like the rest of the menus do on