SearchView.OnCloseListener does not get invoked

后端 未结 9 632
慢半拍i
慢半拍i 2020-12-03 22:23

Im using an action bar and adding a searchView to it. I have implemented the searchView.onCLoseListener but this does not seem to be getting invoked. Any suggestions ?

9条回答
  •  悲哀的现实
    2020-12-03 22:46

    Ok. i got the mistake. We cant add a searchCommand and do

    setShowAsAction(MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW)
    

    Doing this would remove the searchText if any and hence we cant do a onClose().

提交回复
热议问题