private void setMenuVisibility() {
    boolean advanced =
        PreferenceManager.getDefaultSharedPreferences(getActivity())
            .getBoolean("i2pandroid.main.showStats", false);
    boolean routerRunning = Util.getRouterContext() != null;

    mConsoleMenu
        .findViewById(R.id.action_logs)
        .setVisibility(routerRunning ? View.VISIBLE : View.GONE);
    mConsoleMenu
        .findViewById(R.id.action_graphs)
        .setVisibility(routerRunning ? View.VISIBLE : View.GONE);
    mConsoleMenu
        .findViewById(R.id.action_peers)
        .setVisibility(advanced && routerRunning ? View.VISIBLE : View.GONE);
    mConsoleMenu
        .findViewById(R.id.action_netdb)
        .setVisibility(advanced && routerRunning ? View.VISIBLE : View.GONE);
  }
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.container_console, container, false);
    // Start with the home view
    if (savedInstanceState == null
        && getChildFragmentManager().findFragmentById(R.id.main_fragment) == null) {
      mMainFragment = new MainFragment();
      mMainFragment.setArguments(getActivity().getIntent().getExtras());
      getChildFragmentManager().beginTransaction().add(R.id.main_fragment, mMainFragment).commit();
    }

    mConsoleMenu = (FloatingActionsMenu) v.findViewById(R.id.console_action_menu);
    mConsoleMenu
        .findViewById(R.id.action_news)
        .setOnClickListener(
            new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                Intent news = new Intent(getActivity(), NewsActivity.class);
                startActivity(news);
              }
            });
    mConsoleMenu
        .findViewById(R.id.action_logs)
        .setOnClickListener(
            new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                Intent log = new Intent(getActivity(), LogActivity.class);
                startActivity(log);
              }
            });
    mConsoleMenu
        .findViewById(R.id.action_graphs)
        .setOnClickListener(
            new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                Intent graphs = new Intent(getActivity(), RateGraphActivity.class);
                startActivity(graphs);
              }
            });
    mConsoleMenu
        .findViewById(R.id.action_peers)
        .setOnClickListener(
            new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                Intent peers = new Intent(getActivity(), PeersActivity.class);
                startActivity(peers);
              }
            });
    mConsoleMenu
        .findViewById(R.id.action_netdb)
        .setOnClickListener(
            new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                Intent netdb = new Intent(getActivity(), NetDbActivity.class);
                startActivity(netdb);
              }
            });
    setMenuVisibility();

    return v;
  }