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;
}
});
精彩评论