The attribute in my activity is like below:
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setHomeButtonEnabled(true);
actionBar.setDisplayShowHomeEnabled(false);
And the menu layout of my menuoption is below:
<item android:id="@+id/action_search"
android:icon="@drawable/ic_action_search"
com.xxx:showAsAction="ifRoom|collapseActionView"
com.xxx:actionViewClass="android.support.v7.widget.SearchView"
android:title="weibo"/>
But if I click the search button and return,the icon of homeasup which I want to use it with navagation drawer would disappear.I do not know why.
Everything will get fine if I remove actionBar.setDisplayShowHomeEnabled(false)
.
.