N
N
Nubbin2017-08-01 19:03:09
Android
Nubbin, 2017-08-01 19:03:09

SearchView autosubmit?

Good evening, guys, I can not understand what the problem is.
here is the code

searchView.setSubmitButtonEnabled(true);

        searchView.setQuery("text", true);
        searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener(){
            @Override
            public boolean onQueryTextChange(String newText){
               Log.d("searchViews", "onQueryTextChange");
                return true;
            }

            @Override
            public boolean onQueryTextSubmit(String query){
                Log.d("searchViews", "onQueryTextSubmit");
                return true;
            }
        });
    }

According to the plan, after opening the search, he should "search immediately for the phrase -> text" and in the "searchViews" log should have got "onQueryTextSubmit" and for some reason it does not react at all.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri, 2017-08-02
@YuryBorodkin

submit, called, emnip, if you press "enter" on the soft keyboard

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question