androidx.fragment.app.Fragment.onCreateOptionsMenu()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(118)

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

Fragment.onCreateOptionsMenu介绍

暂无

代码示例

代码示例来源:origin: ankidroid/Anki-Android

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
  inflater.inflate(R.menu.card_template_editor, menu);
  super.onCreateOptionsMenu(menu, inflater);
}

代码示例来源:origin: cSploit/android

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
  inflater.inflate(R.menu.main, menu);
  mMenu = menu;
  configureMenu();
  super.onCreateOptionsMenu(menu, inflater);
  getActivity().onCreateOptionsMenu(menu);
}

代码示例来源:origin: westnordost/StreetComplete

@Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater)
{
  inflater.inflate(R.menu.menu_quest_selection, menu);
  super.onCreateOptionsMenu(menu, inflater);
}

代码示例来源:origin: cemrich/zapp

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
  super.onCreateOptionsMenu(menu, inflater);
  inflater.inflate(R.menu.fragment_mediathek_list, menu);
}

代码示例来源:origin: proninyaroslav/libretorrent

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater)
{
  super.onCreateOptionsMenu(menu, inflater);
  inflater.inflate(R.menu.add_torrent, menu);
}

代码示例来源:origin: proninyaroslav/libretorrent

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
  super.onCreateOptionsMenu(menu, inflater);
  inflater.inflate(R.menu.add_torrent, menu);
}

代码示例来源:origin: proninyaroslav/libretorrent

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater)
{
  super.onCreateOptionsMenu(menu, inflater);
  inflater.inflate(R.menu.detail_torrent, menu);
}

代码示例来源:origin: proninyaroslav/libretorrent

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater)
{
  super.onCreateOptionsMenu(menu, inflater);
  inflater.inflate(R.menu.feed_items, menu);
}

代码示例来源:origin: offensive-security/nethunter-app

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
  super.onCreateOptionsMenu(menu, inflater);
  inflater.inflate(R.menu.macchanger, menu);
}

代码示例来源:origin: proninyaroslav/libretorrent

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater)
{
  super.onCreateOptionsMenu(menu, inflater);
  if (!isAdded())
    return;
  inflater.inflate(R.menu.feed, menu);
}

代码示例来源:origin: YassinAJDI/PopularMovies

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
  super.onCreateOptionsMenu(menu, inflater);
  inflater.inflate(R.menu.main, menu);
  UiUtils.tintMenuIcon(getActivity(), menu.findItem(R.id.action_sort_by), R.color.md_white_1000);
  if (viewModel.getCurrentSorting() == MoviesFilterType.POPULAR) {
    menu.findItem(R.id.action_popular_movies).setChecked(true);
  } else {
    menu.findItem(R.id.action_top_rated).setChecked(true);
  }
}

代码示例来源:origin: proninyaroslav/libretorrent

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater)
{
  super.onCreateOptionsMenu(menu, inflater);
  if (!isAdded())
    return;
  inflater.inflate(R.menu.main, menu);
  searchView = (SearchView)menu.findItem(R.id.search).getActionView();
  searchView.setMaxWidth(Integer.MAX_VALUE);
  searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener()
  {
    @Override
    public boolean onQueryTextSubmit(String query)
    {
      adapter.search(query);
      /* Submit the search will hide the keyboard */
      searchView.clearFocus();
      return true;
    }
    @Override
    public boolean onQueryTextChange(String newText)
    {
      adapter.search(newText);
      return true;
    }
  });
  searchView.setQueryHint(getString(R.string.search));
}

代码示例来源:origin: gateship-one/odyssey

super.onCreateOptionsMenu(menu, menuInflater);

相关文章