コード例 #1
0
  private void populateWindowList() {
    if (mActionBar == null) {
      // Not needed
      return;
    }

    if (mTermSessions != null) {
      int position = mViewFlipper.getDisplayedChild();
      WindowListAdapter adapter = mWinListAdapter;
      if (adapter == null) {
        adapter = new WindowListActionBarAdapter(mTermSessions);
        mWinListAdapter = adapter;

        SessionList sessions = mTermSessions;
        sessions.addCallback(adapter);
        sessions.addTitleChangedListener(adapter);
        mViewFlipper.addCallback(adapter);
        mActionBar.setListNavigationCallbacks(adapter, mWinListItemSelected);
      } else {
        adapter.setSessions(mTermSessions);
      }
      mActionBar.setSelectedNavigationItem(position);
    }
  }
コード例 #2
0
  @Override
  public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);

    mHaveFullHwKeyboard = checkHaveFullHwKeyboard(newConfig);

    EmulatorView v = (EmulatorView) mViewFlipper.getCurrentView();
    if (v != null) {
      v.updateSize(false);
    }

    if (mWinListAdapter != null) {
      // Force Android to redraw the label in the navigation dropdown
      mWinListAdapter.notifyDataSetChanged();
    }
  }