android-menu

Android menu line break

落花浮王杯 提交于 2019-12-18 07:09:12
问题 I have the following Android menu XML file: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/programma" android:icon="@android:drawable/ic_menu_agenda" android:title="@string/programma" /> <item android:id="@+id/settings" android:icon="@android:drawable/ic_menu_preferences" android:title="@string/settings" /> <item android:id="@+id/help" android:icon="@android:drawable/ic_menu_help" android:title="@string/help" />

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

只愿长相守 提交于 2019-12-18 01:30:32
问题 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? 回答1: If you're looking for a way to fix the buggy

Reuse the Action Bar in all the activities of app

僤鯓⒐⒋嵵緔 提交于 2019-12-17 19:44:53
问题 I am a newbie to android and I was wondering if someone could guide me about how to reuse the action bar in all of my android activities. As far as I have explored, I found out that we have to make a BaseActivity class and extend it in our Activity where we want to reuse it, and also we have to make a xml layout and include it in our activity xml file. I have finished with the BaseActivity part. Now I am sort of confused in framing the xml part and including it. I know how to merge and

How change position of popup menu on android overflow button?

拟墨画扇 提交于 2019-12-17 18:57:48
问题 I just like to implement somethings same as popup menu in the Gmail app, anchored to the overflow button at the top-right. for that I used the same code as google tutorial for android Android popup menu, but for me show pop menu on top of edge of actionbar not under that. If you notice on pop menu of gmail overflow you saw that popmenu take place at edge of actionbar. This is the xml that I used for popup menu: <menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android

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

浪子不回头ぞ 提交于 2019-12-17 18:57:40
问题 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>

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

浪子不回头ぞ 提交于 2019-12-17 04:45:25
问题 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? 回答1: 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 回答2: To solve this I used a custom view as my action bar: @Override protected void

How To show icons in Overflow menu in ActionBar

不问归期 提交于 2019-12-17 02:28:28
问题 I know it's not possible using the native API. Is there a workaround to implement that kind of view? 回答1: 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

Menu Icon is not showing in Android

ε祈祈猫儿з 提交于 2019-12-14 00:00:22
问题 I want to put icon in my menu item but icon is not showing i tried app:showAsAction="always" this but icon is showing on toolbar.But i want show icon with text. And here is my code:- <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" tools:context=".MainActivity"> <item android:id="@+id/action_search" android:title="@string/action_search" android:orderInCategory="1" android:icon="

How can I change option menu in different fragments?

三世轮回 提交于 2019-12-13 12:57:40
问题 I have a Fragment with menu: public class FragmentA extends Fragment { public FragmentA() { setHasOptionsMenu(true); } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ... setHasOptionsMenu(true); } @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { inflater.inflate(R.menu.activity_main_actions, menu); super.onCreateOptionsMenu(menu, inflater); } } I would like to change menu but it doesn't work and keep the old action

How to find out the String ID of an item in the Menu knowing its decimal value?

一世执手 提交于 2019-12-13 12:08:30
问题 I am using android-support-v7-appcompat. In an activity I want to show in the actionbar the back button. I do: public class News extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.act_news_screen); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(false); } } And: @Override public boolean onOptionsItemSelected(MenuItem item) { System.out