Is there any other way to get the searchview tab and put it in a textview? The getText () and setText () methods do not seem to apply to searchview.
or
Is there a way to transfer input from EditText to Searchview?
Please help me find the necessary resources / codes / method on the above issue. Thanks. Here is my code:
public boolean onQueryTextChange(String newText) { // TODO Auto-generated method stub showResults(newText); return false; } @Override public boolean onQueryTextSubmit(String query) { // TODO Auto-generated method stub tvInput = (TextView) findViewById (R.id.tvInput); showResults(query); // searchView.getQuery().toString(); tvInput.setText(searchView.getQuery().toString()); return false; }
I also do it differently. Here:
tvInput = (TextView) findViewById (R.id.tvInput); tvInput.setText(searchView.getQuery());
android searchview
Theresa gamit
source share