android-menu

ANDROID: Overflow not showing on action bar

回眸只為那壹抹淺笑 提交于 2019-12-11 23:45:14
问题 I need that if the tablet does not have the menu hardware button... it will show the menu button on the software buttons as you see here: So I've googled a bit and found out that to display this button you only need to: "set minSdkVersion to 10 or lower, set targetSdkVersion to 11, 12, or 13, and you do not use ActionBar, the system will add the legacy overflow button when running your app on a handset with Android 4.0 or higher." "Set your android:targetSdkVersion and your android

onCreateOptionsMenu is not called after a fragment add & remove

六月ゝ 毕业季﹏ 提交于 2019-12-11 23:29:31
问题 I have a fragment where I can call ActivityCompat.invalidateOptionsMenu(getActivity()); and the method onCreateOptionsMenu() is successfully called on both: Activity and Fragment. However, when I add a fragment on top of the fragment with: transaction.add(R.id.fragment_home, fragment2, "fragment_ID"); transaction.addToBackStack(null); transaction.commit(); and later close it (either by backPress or by getSupportFragmentManager().popBackStack(); ), ActivityCompat.invalidateOptionsMenu

How to manipulate the Activity's Options Menu

元气小坏坏 提交于 2019-12-11 19:23:46
问题 I've Googled and come up with no code on how to manipulate what the settings button does, or what is brought up when the settings touch button on the phone is pressed. Here is a screenshot of what I mean: At the bottom, you can see that it says settings, but when I click on it, nothing happens. I want to change what happens when it is clicked. Also, I want to be able to change what is brought up (the settings option in the screenshot is what's brought up) when the settings button on the

Locked first element in android sliding menu

若如初见. 提交于 2019-12-11 18:13:03
问题 I'm designing android side sliding menu based on examples with navigation drawer pattern like this : <android.support.v4.widget.DrawerLayout > <FrameLayout> ... </FrameLayout> <ListView> ... </ListView> </android.support.v4.widget.DrawerLayout> To achieve something like this: In upper case we have view(2) as ListView but how to put in that menu locked element like (1) one, regarding to upper xml. I've tryied enclosing ListView in relative/linear layout like: <android.support.v4.widget

Styling toolbar menu item title

我的梦境 提交于 2019-12-11 15:52:41
问题 I am trying to achieve the Menu Item design as shown in the YouTube application screen below. The menu item I am interested in is the action menu item. In this case the (G) Currently, my application Looks like the image below: My style and Background xml are as follows: <resources> // The themes are structured as follows : // Theme 1 (One) : Application Theme <style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar"> <item name="colorPrimary">@color/primary</item> <item name=

Toolbar's popup menu - custom background (color and borders)

纵然是瞬间 提交于 2019-12-11 14:15:21
问题 How can I make such popup item menu for my toolbar (support v7)? screenshot of transparent toolbar's popup menu (MX Player) I found out how to make transparent background: from layout <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:theme="@style/MyToolbarTheme"/> from style <style name="ToolbarTheme" parent="ThemeOverlay.AppCompat.Dark.ActionBar"> <item name="android:colorBackground">@color/my

Android - want to show 3-dots menu on ICS

帅比萌擦擦* 提交于 2019-12-11 12:56:12
问题 I want to show the 3-dot overflow menu key (next to the RecentApp virtual key) when building my app with android:targetSdkVersion="15" Here is my story. My app includes two lib projects (only jars + res no source), lib-a is using menu; when the app was built with target-sdk=10, works well, the 3-dot icon shows up next to RecentApp key on system navigation bar. Now lib-b got upgraded, I HAVE to build the app with target-sdk=15, but this makes lib-a UI menu disappear. I want lib-a to have menu

no callback to onOptionsMenuClosed(). and getting error in overriding onPanelClosed() functions

拟墨画扇 提交于 2019-12-11 11:44:25
问题 I have a fragment which is made using PreferenceFragment ,where I am overriding onOptionsMenuClosed(). But , its the callback is not coming to it.Neither is the call back coming to OnMenuOpened(), OnPanelCosed()... This is what i have alredy tired. @Override public void onOptionsMenuClosed(Menu menu) { // TODO Auto-generated method stub Log.e(TAG, "close optionmenu"); super.onOptionsMenuClosed(menu); } and for onPanelClosed this is what i am trying. @Override public void onPanelClosed(int

How to check that options menu is opened?

旧巷老猫 提交于 2019-12-11 09:24:43
问题 How to check that options menu is opened? (menu in actionbar, or menu from preference button in older devices) There is some method for this? 回答1: Have a look at this SO question : How do I programmatically check if the menu of my activity is showing at a particular moment? Not a proper solution but the best workaround possible at the moment. 来源: https://stackoverflow.com/questions/20990197/how-to-check-that-options-menu-is-opened

Custom item in the BottomNavigationView

自古美人都是妖i 提交于 2019-12-11 09:05:26
问题 I would like to create a BottomNavigationView with menu with one custom layout item, but this custom layout is not visible in application. This is the menu: <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/menu_shopping" android:icon="@drawable/ic_tab_list" android:title="@string/shopping" /> <item android:id="@+id/menu_measurement" android:icon="@drawable/ic_tab_measure" android:title="@string