示例#1
0
  // called when rotating screen
  @Override
  public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);
    main = View.inflate(this, R.layout.main, null);
    setContentView(main);

    if (Build.VERSION.SDK_INT >= 11) {
      Honeycomb.invalidateOptionsMenuWrapper(this);
    }

    registerForContextMenu(findViewById(android.R.id.list));

    // add note to pane for tablet
    rightPane = (LinearLayout) findViewById(R.id.right_pane);

    if (rightPane != null) {
      content = (TextView) findViewById(R.id.content);
      title = (TextView) findViewById(R.id.title);
      updateTextAttributes();
      showNoteInPane(lastIndex);
    } else updateNotesList(query, -1);

    // set the view shown when the list is empty
    updateEmptyList(query);
  }