How to get a text from SearchView? : <p>I need to get a text from SearchView and compare it to strings in my activity's ListView and show a Toast if the word in a SearchView is in my ListView. How do I do that? Here's my working code for the SearchView:</p>

<pre><code>MenuItem ourSearchItem = menu.findItem(R.id.menu_item_search);

        SearchView sv = (SearchView) ourSearchItem.getActionView();

        sv.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
            @Override
            public boolean onQueryTextSubmit(String query) {
                return false;
            }

            @Override
            public boolean onQueryTextChange(String newText) {

                adapter.getFilter().filter(newText);
                }
                return false;
            }
        });
</code></pre>
