草庐IT

setOnActionExpandListener

全部标签

android - 即使我正在使用 MenuItemCompat.setOnActionExpandListener 我的应用程序也会崩溃,建议使用 MenuItemCompat.setOnActionExpandListener

这个问题在这里已经有了答案:AndroidSupportRepo46.0.0withAndroidStudio2.3(7个答案)关闭5年前。今天AndroidStudio(设置为稳定channel更新)让我下载Android支持存储库46.0.0的更新,所以我照做了。然后突然之间,我们的应用程序每次都开始崩溃,因为MenuItemCompat.setOnActionExpandListener。是的,我应该查看发行说明,但我没有-这是事实。现在我们的问题是什么-即使我们使用推荐的符号MenuItemCompat.setOnActionExpandListener,我们的应用程序崩溃了,

android - java.lang.UnsupportedOperationException : This is not supported, 使用 MenuItemCompat.setOnActionExpandListener()

我最近从Eclipse迁移到AndroidStudio,在这样做时我发现了以下错误java.lang.UnsupportedOperationException:Thisisnotsupported,useMenuItemCompat.setOnActionExpandListener()atandroid.support.v7.internal.view.menu.MenuItemImpl.setOnActionExpandListener(MenuItemImpl.java:740)atbiz.nickbullcomputing.bevnav.MainActivity.onCrea

android - java.lang.UnsupportedOperationException : This is not supported, 使用 MenuItemCompat.setOnActionExpandListener()

我最近从Eclipse迁移到AndroidStudio,在这样做时我发现了以下错误java.lang.UnsupportedOperationException:Thisisnotsupported,useMenuItemCompat.setOnActionExpandListener()atandroid.support.v7.internal.view.menu.MenuItemImpl.setOnActionExpandListener(MenuItemImpl.java:740)atbiz.nickbullcomputing.bevnav.MainActivity.onCrea

android - 如何在 API 级别 8+ 中支持 searchItem.setOnActionExpandListener?

我正在使用ActionBarActivity,如何在API级别8+中支持searchItem.setOnActionExpandListener?它表示为此需要最低API级别14。下面是我的代码,目前我正在抑制错误并仅在API>=14时才允许执行代码。@SuppressLint("NewApi")publicbooleanonCreateOptionsMenu(Menumenu){getMenuInflater().inflate(R.menu.action_bar_home_screen,menu);searchItem=menu.findItem(R.id.action_searc

android - 无法设置 OnActionExpandListener : This is not supported, 使用 MenuItemCompat.setOnActionExpandListener()

这听起来像是一个重复的问题,但事实并非如此。我正在尝试设置OnActionExpandListener到我的搜索菜单项:publicbooleanonCreateOptionsMenu(Menumenu){MenuInflaterinflater=getMenuInflater();inflater.inflate(R.menu.menu_country_picker,menu);MenuItemmenuItem=menu.findItem(R.id.search);menuItem.setOnActionExpandListener(this);//morecodereturntru

android - MenuItemCompat.setOnActionExpandListener 已弃用

如果搜索View是否打开,我有一些代码可以设置一个bool值。MenuItemCompat.setOnActionExpandListener(action_search,newMenuItemCompat.OnActionExpandListener(){@OverridepublicbooleanonMenuItemActionExpand(MenuItemitem){isSearch=true;returntrue;}@OverridepublicbooleanonMenuItemActionCollapse(MenuItemitem){isSearch=false;return

android - MenuItemCompat.setOnActionExpandListener 什么都不做

背景我有一个正在使用我创建的特殊类初始化的searchView,它被用于所有Activity和fragment。问题最近可能是支持库更新的缘故(也可能是之前没用过,记不太清了),抓不到searchView展开/折叠的事件。正如我所发现的,即使我将setSupportActionBar与Toolbar实例一起使用,也会发生这种情况。我尝试过的我已经尝试使用下面的每一种方法,但都没有用:MenuItemCompat.setOnActionExpandListener。MenuItemCompat.setOnActionExpandListener以及图标化SearchView,如某些网站所

java - android searchview setOnActionExpandListener on Honeycomb 3.2

我正在使用android-support-v4开发适用于Android3.2及更高版本的应用。当操作栏中的SearchView展开和折叠时,我需要实现OnActionExpandListener以“拦截”。我的Android4.0及更高版本的代码没问题,但3.2不行。menu.xmlMyActivity.java@OverridepublicbooleanonCreateOptionsMenu(Menumenu){getMenuInflater().inflate(R.menu.reader,menu);finalMenuItemsearchMI=menu.findItem(R.id.