how to handle back button of Search View in android

前端 未结 4 1237
刺人心
刺人心 2021-02-19 13:24
SearchView searchView = (SearchView) MenuItemCompat.getActionView(menu.findItem(Menus.SEARCH));
searchView.setQueryHint(this.getString(R.string.search));
editSearch = (E         


        
4条回答
  •  臣服心动
    2021-02-19 13:41

    Here is a way of doing it -

    @Override
    public void onBackPressed() {
    
        // Write your code here
    
        super.onBackPressed();
    }
    

提交回复
热议问题