android-menu

How to make option menu appear on bottom of the screen?

核能气质少年 提交于 2019-12-22 02:17:08
问题 Here is what I am trying to implement: when people click on the menu on top right corner of a toolbar, an options menu appears on bottom of the screen. See picture below: I am not sure what method should I call for the item at the bottom. Can somebody give me some hint on how to implement this? I implement successfully the icon in the top right menu bar with the code below. But I don't know how to show the options at the bottom of the screen, with width match_parent , and height wrap_content

Android : Change cart menu badge counter from Recycler Adapter

不羁岁月 提交于 2019-12-21 06:25:25
问题 I am trying to develop e-commerce type of app in which user can add item to cart. But I am unable to update the cart badge counter from adapter. Here is screenshot of my app. I am using Recycler view inside fragment. And I am referring this below link for menu item count. https://mobikul.com/adding-badge-count-on-menu-items-like-cart-notification-etc/ My problem is I cannot access menu item from adapter. Here is my fragment code. PriceListFragment.java public class PriceListFragment extends

No resource identifier found for attribute 'showAsAction' in package 'android'

心已入冬 提交于 2019-12-21 03:44:06
问题 as the title suggest, I'm getting that error in at least 3 of the XML layout files, however, I dont see the attritube "showsAsAction" in any of those XML files, did I miss something or am I just blind?, here are the XML files in question: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <Button android:id="@+id/findSelected"

ActionBar capacity/overflow not changing on orientation change

丶灬走出姿态 提交于 2019-12-20 10:44:24
问题 I have an app using the ActionBar, where I handle orientation changes myself: android:configChanges="keyboard|keyboardHidden|orientation|screenSize" ...and the menu should fit in the ActionBar without overflow in landscape, but not in portrait: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:title="@string/Game" android:id="@+id/game" android:icon="@android:drawable/ic_menu_manage" android:showAsAction="ifRoom|withText"/>

Different menu for different tabs in tab+swipe application for android project

南笙酒味 提交于 2019-12-20 10:43:21
问题 I am a beginner to android applications and java, basically I am a PHP developer. I've a project for a tab+swipe application, Reseller.java package com.idevoc.onsitereseller; import java.util.ArrayList; import android.app.ActionBar; import android.app.ActionBar.Tab; import android.app.Activity; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentManager; import android.support.v4.app

Cannot instantiate class android.support.v7.widget.SearchView

醉酒当歌 提交于 2019-12-19 05:04:36
问题 Please somebody help me! I trying add appcompat search view to my project. Unsuccessfully. When I change android.support.v7.widget.SearchView to SearchView (API > 10) everything's fine. This my menu res: <item android:id="@+id/action_search" android:title="@string/search_view_title" android:icon="@drawable/action_search" sabd:showAsAction="always|collapseActionView" sabd:actionViewClass="android.support.v7.widget.SearchView" /> This how I try to use SeachView: @Override public void

Using Android action bar share intent

冷暖自知 提交于 2019-12-19 04:16:08
问题 I'm using a menu item on the action bar and I want to share my app by clicking the share icon. When I click the share icon it doesn't work. Also, I want to add text saying "install this app" when shared. Here is my code: private ShareActionProvider mShareActionProvider; @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.mainpage, menu); MenuItem item = menu.findItem(R.id.menu_item

Custom Menu item in Overflow menu

余生长醉 提交于 2019-12-19 04:07:15
问题 How should i make a Custom MenuItem, exactly like the first row in the menu of the attached picture ( screenshot of Google Chrome app) I have tried the below code in onCreateOptionsMenu , where R.layout.menu_top_row is the layout for the first row.But only a blank row comes up in my case? I am able to display rest of the options, but unable to display the first row. View child = getLayoutInflater().inflate(R.layout.menu_top_row, null); MenuItem menuItem=menu.add(""); menuItem.setActionView

Android Action Bar menu not showing when target sdk version is greater than 10. Why?

北城余情 提交于 2019-12-18 13:31:55
问题 I have an application wide menu that won't always show. Specifically specifically my issue is that when I set the target sdk version to 16 for devices with no hardware menu button The 3 dots (Action bar?) that should appear actua\lly don't. I have the following manifest entries <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="10" /> In an avd emulator with no hardware buttons I see the 3 dots for the action bar menu But if I set the target to 16 <uses-sdk android:minSdkVersion="8

How to make whatsapp type of animation for opening the menu from toolbar(actionbar)

£可爱£侵袭症+ 提交于 2019-12-18 11:02:30
问题 Description: I recently updated whatsapp and noticed the animation for menu item clicked on toolbar. How to achieve this effect? Are there any opensource projects to achieve this? I have not posted any code because. I have no clue how they are doing it. Snapshot-1 : Before clicking the attachment button in menu Snapshot-2 : After clicking the attachment button in menu How to Achieve this? 回答1: Seems like they "ported" lollipop animation in pre-L devices. The simplest way to do this is using