I'm having trouble sending my submit button for the request to work. I have this part of my code here.
searchView.setIconifiedByDefault(true);
searchView.setSubmitButtonEnabled(true);
and I also have a listener
new SearchView.OnQueryTextListener(){
@Override
public boolean onQueryTextChange(String newText) {
return false;
}
@Override
public boolean onQueryTextSubmit(String query) {
Context context = getApplicationContext();
CharSequence start = "Start";
int duration = Toast.LENGTH_SHORT;
Toast toast = Toast.makeText(context, start, duration);
toast.show();
return false;
}
};
When the submit button is pressed, it does not show a toast, so I assume that when you click the submit button, it does not do what it should do. I do not know what is wrong here.
source
share