我想处理折叠状态,但我无法处理 onActionExpandListener。我使用 actionbarsherlock,这是我的代码。我在哪里犯错?
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getSupportMenuInflater().inflate(R.menu.main, menu);
menu.getItem(0).setVisible(aramaOnOff);
menu.getItem(1).setVisible(filterOnOff);
SearchView searchView = (SearchView)menu.findItem(R.id.imgBuyutec).getActionView();
searchView.setOnQueryTextListener(this);
searchViewItem = menu.findItem(R.id.imgBuyutec);
searchViewItem.setOnActionExpandListener(new MenuItem.OnActionExpandListener() {
@Override
public boolean onMenuItemActionExpand(MenuItem item) {
// TODO Auto-generated method stub
return true;
}
@Override
public boolean onMenuItemActionCollapse(MenuItem item) {
return true;
}
});
return true;
}