Android的 - 自定义快速搜索框 [英] Android - custom quick search box

查看:622
本文介绍了Android的 - 自定义快速搜索框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果您使用Twitter为Android,你可以看到,点击手机的硬盘搜索按钮带来了完全自定义的快速搜索般的控制。现在,我不是说这是股票的Andr​​oid定制的快速搜索,但怎么总会有建立这样的事情?
我想快速搜索框行为,但我也想添加一些额外的选择(认为Firefox搜索,其中左侧有一个下拉菜单选择搜索引擎)
我怀疑,点击搜索带来的另一个活动,只是看起来像一个快速搜索。现在我知道如何从快速搜索触发的搜索活动,但如何快速拦截电话盒,并显示您的活动呢?
我会在哪里开始这样的事情?任何提示和指针将大大AP preciated

If you using Twitter for Android you can see that clicking on phone's hard search button brings fully customized quick search-like control. Now I'm not saying that it IS stock Android customized quick search but how would one build something like that? I want quick search box behavior but I also want add some additional selectors (think Firefox search where on the left there's a dropdown to select search engine) I suspect that clicking search brings another activity that just looks like a quick search. Now I know how to trigger search activity from the quick search but how to intercept quick box call and display your activity instead? Where would I start with something like that? Any hints and pointers will be greatly appreciated

推荐答案

由于没有截图,我不禁非常多,因为我不使用官方Twitter的应用程序(我是一个Seesmic的家伙),所以我不太知​​道你在说什么。

With no screenshot, I can't help terribly much, since I don't use the official Twitter app (I'm a Seesmic guy), so I don't quite know what you are talking about.

您可以覆盖 onSearchRequested()当用户请求在你的活动搜索,获得控制权。返回真正说你处理搜索自己。一路上,弹出任何你想允许用户执行搜索。

You can override onSearchRequested() to get control when the user requests a search in your activity. Return true to say you're handling the search yourself. Along the way, pop up whatever you like to allow the user to do a search.

这篇关于Android的 - 自定义快速搜索框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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