Bir menü öğesinde actionLayout kullanılırken onOptionsItemSelected yöntemine çağrılmadı. Bir şey eksik mi, yoksa SherlockActionBar ile bilinen bir sorun mu?onOptionsItemSelected actionLayout (SherlockActionBar) kullanırken çağrılmadı
Etkinlik
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getSupportMenuInflater();
inflater.inflate(R.menu.article, menu);
super.onCreateOptionsMenu(menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
Log.d(TAG, "onOptionsItemSelected()");
switch (item.getItemId()) {
case android.R.id.home:
finish();
return true;
case R.id.menu_item_comment:
return true;
default:
return super.onOptionsItemSelected(item);
}
}
Menü iyi
<item android:id="@+id/menu_item_comment"
android:showAsAction="ifRoom"
android:actionLayout="@layout/action_bar_comment_layout"/>
'@ layout/action_bar_comment_layout' nasıl görünüyor? –