开发者

On the fly android search using quick search box

I've implemented a search in my application using The quick search box, now i wan开发者_JS百科t the search results to show on the fly as the user types.

Is it possible?


Try setting a setOnKeyListener() on your View.

view.setOnKeyListener(new OnKeyListener()
{
    @Override
    public boolean onKey(View v, int keyCode, KeyEvent event)
    {
        if ((event.getAction() == KeyEvent.ACTION_DOWN)
            && (keyCode == KeyEvent.KEYCODE_ENTER))
        {
            // Perform action on key press - pop up your search box and focus on it

            return true;
        }
        return false;
    }
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜