title: Change default search icon position in search view
body: <p>I use Search view in my project for adding search ability for users. my problem is I want to change search icon position from right side of toolbar to left side.</p>
  
  <p>this is my menu code:</p>
  
  <pre><code>&lt;menu xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity"&gt;
  &lt;item
      android:id="@+id/action_search"
      android:title="@android:string/search_go"
      android:icon="@drawable/search"
      app:showAsAction="ifRoom|collapseActionView"
      app:actionViewClass="android.support.v7.widget.SearchView"
      android:visible="true"/&gt;
  </code></pre>
  
  <p></p>
  
  <p>and this is my activity code:</p>
  
  <pre><code>private SearchView mSearchView;
  private MenuItem searchMenuItem;
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.menu_main, menu);
      searchMenuItem = menu.findItem(R.id.action_search);
      mSearchView = (SearchView) searchMenuItem.getActionView();
      mSearchView.setLayoutParams(new ActionBar.LayoutParams(Gravity.LEFT));
      mSearchView.setOnQueryTextListener(listener);
      return true;
  }
  
  SearchView.OnQueryTextListener listener = new SearchView.OnQueryTextListener() {
      @Override
      public boolean onQueryTextSubmit(String query) {
          if (query.equals("") || query.equals(" ")){
              Toast.makeText(G.context,"ابتدا یک متن برای جستجو بنویسید.",Toast.LENGTH_SHORT).show();
              return false;
          }
          Intent intent = new Intent(ContentsActivity.this,SearchActivity.class);
          intent.putExtra("KEYWORD", query);
          ContentsActivity.this.startActivity(intent);
          return false;
      }
  
      @Override
      public boolean onQueryTextChange(String newText) {
          return false;
      }
  };
  </code></pre>