动作条下拉菜单单击事件 [英] Actionbar dropdown click event

查看:147
本文介绍了动作条下拉菜单单击事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有下拉列表中的动作条为导航列表。使用 ActionBar.OnNavigationListener onNavigationItemSelected 以检测当用户点击了项目的动作条下拉导航列表中,并且工作正常。

I have dropdown list in actionbar as navigation list. Using ActionBar.OnNavigationListener and onNavigationItemSelected to detect when user has clicked on item in actionbar dropdown navigation list and that works fine.

不过, onNavigationItemSelected 不叫如果用户点击了相同的项目,这是目前在下拉列表中选择一个! (我需要的应用程序,这个确切的功能行为正常工作)

However, onNavigationItemSelected is not called if user has clicked on the same item as the one which is currently selected in dropdown list! (I need this exact functionality behavior for app to work properly)

那么,有没有办法来检测点击任何部分的下拉列表中动作条的?

So is there any way to detect click on any part of the dropdown list in actionbar?

有没有办法以某种方式引用下拉列表视图动作条,然后设置onclicklistner在动作条的下拉列表对象。就像当我们使用下拉列表中的标准布局?

Is there a way to somehow reference dropdown view in actionbar, and then set onclicklistner on that dropdown object in actionbar. Like when we use dropdown list in standard layout?

推荐答案

这里的问题是一样的任何其他微调。该workariund这显然是这里描述:<一href="http://stackoverflow.com/questions/10854329/spinner-onitemselected-not-called-when-selected-item-remains-the-same">Spinner :当选定项保持不变 onItemSelected不叫

The problem here is the same as with any other Spinner. The workariund for this is clearly described here: Spinner : onItemSelected not called when selected item remains the same

不过,对于动作条的解决方案可以是一个有点棘手(除了当您使用的 ActionBarSherlock 的并能明确地惹了code)

However for the ActionBar the solution can be a bit tricky (except for when you are using the ActionBarSherlock and can explicitly mess with its code)

这篇关于动作条下拉菜单单击事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆