title: I want to implement Autocompletetextview in toolbar
body: <p>Here is my code. I am using menu_search to display Search icon. Search_layout is showing autocompletetextview. I don't know where to initialize autocompletetextview in mainactivity.</p>
  
  <p><strong>menu_search.xml</strong>
          </p>
  
  <pre><code>        &lt;item android:id="@+id/action_search"
              android:name="search"
              android:title="search"
              android:imeOptions="actionSearch"
              android:inputType="textAutoComplete|textAutoCorrect"
              app:actionLayout="@layout/search_layout"
              android:icon="@android:drawable/ic_menu_search"
              app:showAsAction="ifRoom|collapseActionView"/&gt;
  
      &lt;/menu&gt;
  </code></pre>
  
  <p><strong>search_layout.xml</strong>
          
          </p>
  
  <pre><code>        &lt;AutoCompleteTextView
              android:id="@+id/autoCompleteTextView_searchWidget"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:padding="5dp"
              android:textColor="@color/colorAccent"
              android:imeOptions="actionSearch"
              android:inputType="text"&gt;
              &lt;requestFocus/&gt;
          &lt;/AutoCompleteTextView&gt;
  
      &lt;/LinearLayout&gt;
  </code></pre>
  
  <p><strong>MainActivity.java</strong></p>
  
  <pre><code>    public class MainActivity extends AppCompatActivity {
      private Toolbar toolbar;
          private TabLayout tabLayout;
          private ViewPager viewPager;
  
        @Override
          protected void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              setContentView(R.layout.activity_main);
  
              toolbar = (Toolbar) findViewById(R.id.toolbar);
              setSupportActionBar(toolbar);
              //getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  
              viewPager = (ViewPager) findViewById(R.id.viewpager);
              setupViewPager(viewPager);
  
              tabLayout = (TabLayout) findViewById(R.id.tabs);
              tabLayout.setupWithViewPager(viewPager);
              //setupTabIcons();
          }
  
          @Override
          public boolean onCreateOptionsMenu(Menu menu) {
  
              getMenuInflater().inflate(R.menu.menu_search,menu);
              return super.onCreateOptionsMenu(menu);
          }
  
          @Override
          public boolean onOptionsItemSelected(MenuItem item) {
              return super.onOptionsItemSelected(item);
          }
  }
  </code></pre>