// 将通讯录列表fragment动态集成进来。 开发者也可以使用在xml中配置的方式静态集成。
  private void addContactFragment() {
    fragment = new ContactsFragment();
    fragment.setContainerId(R.id.contact_fragment);

    TActionBarActivity activity = (TActionBarActivity) getActivity();

    // 如果是activity从堆栈恢复,FM中已经存在恢复而来的fragment,此时会使用恢复来的,而new出来这个会被丢弃掉
    fragment = (ContactsFragment) activity.addFragment(fragment);

    // 功能项定制
    fragment.setContactsCustomization(
        new ContactsCustomization() {
          @Override
          public Class<? extends AbsContactViewHolder<? extends AbsContactItem>>
              onGetFuncViewHolderClass() {
            return FuncItem.FuncViewHolder.class;
          }

          @Override
          public List<AbsContactItem> onGetFuncItems() {
            return FuncItem.provide();
          }

          @Override
          public void onFuncItemClick(AbsContactItem item) {
            FuncItem.handle(getActivity(), item);
          }
        });
  }
  @Override
  public void onBackPressed() {
    if (adapter.switchMode()) {
      return;
    }

    super.onBackPressed();
  }
 @Override
 protected void onActivityResult(int requestCode, int resultCode, Intent data) {
   super.onActivityResult(requestCode, resultCode, data);
   if (requestCode == REQUEST_CODE_CONTACT_SELECT && resultCode == Activity.RESULT_OK) {
     final ArrayList<String> selected =
         data.getStringArrayListExtra(ContactSelectActivity.RESULT_DATA);
     if (selected != null && !selected.isEmpty()) {
       addMembersToTeam(selected);
     }
   }
 }
  /** ***************************** Life cycle ***************************** */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.nim_team_info_activity);

    parseIntentData();
    initToggleBtn();
    loadTeamInfo();
    initAdapter();
    findViews();
    requestMembers();

    registerObservers(true);
  }
 @Override
 protected void onDestroy() {
   super.onDestroy();
   registerObservers(false);
 }
 @Override
 protected void onResume() {
   super.onResume();
 }