android.support.v4.app.FragmentActivity.onMenuItemSelected()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(1.0k)|赞(0)|评价(0)|浏览(116)

本文整理了Java中android.support.v4.app.FragmentActivity.onMenuItemSelected()方法的一些代码示例,展示了FragmentActivity.onMenuItemSelected()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FragmentActivity.onMenuItemSelected()方法的具体详情如下:
包路径:android.support.v4.app.FragmentActivity
类名称:FragmentActivity
方法名:onMenuItemSelected

FragmentActivity.onMenuItemSelected介绍

[英]Dispatch context and options menu to fragments.
[中]将上下文和选项菜单分派到片段。

代码示例

代码示例来源:origin: shazam/android-aspects

@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
  return super.onMenuItemSelected(featureId, item) || dispatcher.dispatchOnMenuItemSelected(this, featureId, item);
}

代码示例来源:origin: nekocode/JarFilterPlugin

@Override
public final boolean onMenuItemSelected(int featureId, android.view.MenuItem item) {
  if (super.onMenuItemSelected(featureId, item)) {
    return true;
  }
  final ActionBar ab = getSupportActionBar();
  if (item.getItemId() == android.R.id.home && ab != null &&
      (ab.getDisplayOptions() & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
    return onSupportNavigateUp();
  }
  return false;
}

相关文章

微信公众号

最新文章

更多

FragmentActivity类方法