I has create an activity for search something.
but I want search view is searching status when I start this activity.
So..... like this, I create search view from option menu. but setIconified set value false for set first open activity search view is open .
but I want search view is searching status when I start this activity.
So..... like this, I create search view from option menu. but setIconified set value false for set first open activity search view is open .
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); setContentView(R.layout.xxx.xml) configActionBar(); loadData(); if (mSearchView != null && mSearchView.isIconified()) { mSearchView.setIconified(false); }}public boolean onCreateOptionsMenu(Menu menu) {getSupportMenuInflater().inflate(R.menu.search_button, menu); mSearchView = (SearchView) menu.findItem(R.id.search).getActionView(); return super.onCreateOptionsMenu(menu);}
评论
发表评论