I need to implement some action after clicking the up icon after searching in my ListView
via SearchView
. How can i get UP
event, i.e. how can i implement the click event for UP
icon.
I need to implement some action after clicking the up icon after searching in my ListView
via SearchView
. How can i get UP
event, i.e. how can i implement the click event for UP
icon.
Found my own answer, Instead of relying on UP
icon event, i implemented OnActionExpandListener
which worked exactly what i wanted.
menuItem.setOnActionExpandListener(new OnActionExpandListener()
{
@Override
public boolean onMenuItemActionCollapse(MenuItem item)
{
// Do something when collapsed
return true; // Return true to collapse action view
}
@Override
public boolean onMenuItemActionExpand(MenuItem item)
{
// Do something when Expanded
return true;
}
});