title: how to submit text in searchview programmatically?
body: <p>How can I submit text inside a SearchView programmatically?</p>
  
  <p>I get text from previous activity and put it in the <code>SearchView</code> in the 2nd activity. </p>
  
  <pre><code>    // get text from previous activity
      schoolDbn = getIntent().getExtras().getString("dbn");
  
      final SearchView searchView = findViewById(R.id.searchID);
  
  
      searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() 
       {
          @Override
          public boolean onQueryTextSubmit(String s) {
              myadapter.getFilter().filter(s);
              return true;
          }
  
          @Override
          public boolean onQueryTextChange(String s) {
              myadapter.getFilter().filter(s);
              return true;
          }
      });
  
      // sets text from first activity
      searchView.setQuery(schoolDbn, true);
  
      }
  </code></pre>
  
  <p><strong>SearchView XML</strong> </p>
  
  <pre><code>    &lt;android.support.v7.widget.SearchView
      android:id="@+id/searchID"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"&gt;
      &lt;/android.support.v7.widget.SearchView&gt;
  </code></pre>
  
  <p><strong>What I want to happen</strong> User clicks item in first activity and in 2nd activity SearchView auto submits text.</p>