code: public void setQuery(CharSequence query, boolean submit) {
          if (searchView != null) {
              searchView.setQuery(query, submit);
          } else if (supportView != null) {
              supportView.setQuery(query, submit);
          } else {
              throw new IllegalStateException(ERROR_NO_SEARCHVIEW);
          }
      }
docs: Sets a query string in the text field and optionally submits the query as well.
  
  @param query  the query string. This replaces any query text already present in the
  text field.
  @param submit whether to submit the query right now or only update the contents of
  text field.