android-menu

Android App development error: “Bad XML block: header size 60 or total size 3932356 is larger than data size 0” [closed]

时光总嘲笑我的痴心妄想 提交于 2019-11-29 09:07:33
I checked other posts that were similar and they recommended to clean the build path, but that did not help at all. I have started android app development and am having a frustrating problem with adding a menu to an activity. <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/save_tea" android:title="@string/save_tea_label" /> </menu> This throws the "Bad XML block: header size 60 or total size 3932356 is larger than data size 0" in the Eclipse console. I have a menu for the main app activity and it works fine, but

Having two single-selection groups in ActionBar doesn't work, but attaching a pop up menu instead doesn't work either

感情迁移 提交于 2019-11-29 07:22:54
I am writing an Android app where the user must choose how and what to display on a graph. These options are expressed in two single-selection menu groups (radio buttons), both of which should be accessible from the action bar. The first group works fine. It's added at the end of my ActionBar XML like this: <group android:checkableBehavior="single" android:showAsAction="never" > <item android:id="@+id/menu_choice_1" android:title="Choice 1" /> <item android:id="@+id/menu_choice_2" android:title="Choice 2" android:checked="true"/> </group> When I add a second <group> below the first one,

How to get dividers in NavigationView menu without titles?

六月ゝ 毕业季﹏ 提交于 2019-11-29 06:01:43
问题 I am using the new NavigationView to create my navigation drawer menu from XML. I need to place a divider between the section menu items, which switch between the sections of my app, and the settings and help & support links at the bottom. In all the examples I've seen, I see how this can be done by putting another <menu> within an <item> , but the <item> requires to have the android:title attribute, so the best I can do is make the title blank, which leaves an empty space before the settings

How to override web view text selection menu in android

点点圈 提交于 2019-11-29 03:26:53
The basic android's web text selection menu is as shown in image attached below. It has options like copy, share, select all, web search. I want to over ride this menus and want them as my own menu list like "mark colour", "mark as imp" etc. I look around most of the questions available about context menu on stack overflow. The most of the question relate with context menu but not giving result as expected. I want menu like below image When I perform selection android monitor shows some view creation form viewRoot like D/ViewRootImpl: #1 mView = android.widget.PopupWindow$PopupDecorView

Android Studio 3.1 does not showing 'android' option under Tools menu

♀尐吖头ヾ 提交于 2019-11-29 01:02:48
I am using android studio 3.1 for some development. But Its does not showing android option under Tools menu. Whereas Android studio 3.0 doesn't have this problem. Here is the screenshot of android studio 3.1 Tools menu: See missing the android option. I think this is some configuration related problem as it doesn't exist in android studio 3.0. Basically I need Enable ADB Integration option. Is there any way to show the option in Tools menu? If you're looking for a way to fix the buggy connection to a physically connected USB device without restarting Android Studio, this might help:

Vertical sliding menu in Android

≯℡__Kan透↙ 提交于 2019-11-29 01:00:23
问题 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. 回答1: This UI Pattern is currently being referred to as Side Navigation and discussed in some detail here: http://www.androiduipatterns.com/2012/06/emerging-ui-pattern-side-navigation.html I think this is what you are looking for :) https://github.com/korovyansk/android-fb-like-slideout-navigation The side

Reduce Menu items width,height and textview size

好久不见. 提交于 2019-11-28 20:44:33
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" />

showAsAction=“ifRoom” doesn't show the item even when there is plenty of room

元气小坏坏 提交于 2019-11-28 19:32:19
问题 I am trying to get the ActionBar working properly on my app (and I'm using ActionBarSherlock to get a unified UI between Android 2.x and 4.x). I feel like android:showAsAction="ifRoom" is just a big, fat lie. Whenever I set an action to ifRoom it ALWAYS shows up in the overflow menu even if there is PLENTY of room. Here are two screenshots from the same emulator. The first shows the ActionBar with all options set to always and the second shows the ActionBar with the last two options set to

How to add menu button without action bar?

浪子不回头ぞ 提交于 2019-11-28 19:11:36
I'd like to add a menu button to the right top corner of my app and without action bar, like it is in Google Fit app on the screenshot below. Can anyone help me? You can simply use PopupMenu , for example add the following to a button when clicked: public void showPopup(View v) { PopupMenu popup = new PopupMenu(this, v); MenuInflater inflater = popup.getMenuInflater(); inflater.inflate(R.menu.actions, popup.getMenu()); popup.show(); } For more info, read Creating a Popup Menu : http://developer.android.com/guide/topics/ui/menus.html Add a toolbar the layout and make it transparent. That is the

Setting PopupMenu menu items programmatically

倾然丶 夕夏残阳落幕 提交于 2019-11-28 18:06:04
I have a PopupMenu and I know the usual way to associate a menu to it is to use popup.getMenuInflater().inflate(R.menu.my_menu, popup.getMenu()); or something of the like. My problem is, I have an array of items that I want in the menu and I need to be able to change them programmatically in Java. How can I do this? Just figured it out; for anyone who runs into this same problem you just do: popup.getMenu().add(groupId, itemId, order, title); for each MenuItem you want to add. Just create the popup menu registering the view the popup will show underneath and use the getMenu() method to add the