@Override
  protected void onPause() {
    resetChosenNType();

    if (grpMgr != null) {
      grpMgr.onPause();
    }

    Closed = true;
    // TODO Auto-generated method stub
    super.onPause();
  }
 void doWifiDirect() {
   chosenNType = NetInfo.WiFiDirect;
   if (connNets[NetInfo.WiFiDirect] != null) {
     if (actNetType != NetInfo.WiFiDirect) {
       connMgrService.activateNetwork(connNets[NetInfo.WiFiDirect]);
     } else {
       NetInfo net = connNets[NetInfo.WiFiDirect];
       netActivatedAtLeader(net);
       setUseSSL(peerNetData.useSSL);
     }
   } else {
     Log.d(TAG, "start Wifi Direct network");
     grpMgr.createNetwork();
   }
 }
  @Override
  protected void onDestroy() {
    if (connMgrService != null) {
      Log.d(TAG, "CtorActivity destroyed");
      connMgrService.onConnectorDestroy();
      unbindService(mConnection);
      connMgrService = null;
    }

    if (grpMgr != null) {
      grpMgr.onDestroy();
    }

    // dont destroy connMgrService here
    // since connMgr will start right away
    super.onDestroy();
    Log.d(TAG, "onDestroyed");
  }
  @Override
  protected void onResume() {
    super.onResume();

    //
    if (grpMgr != null) {
      grpMgr.onResume();
    }

    // resume caused by intent from an Android Beam
    if (NfcAdapter.ACTION_NDEF_DISCOVERED.equals(getIntent().getAction())) {
      processNfcIntent(getIntent());
    } else {
      Closed = false;
      //
      // getPeerDeviceNetInfo();
      //
      resumeLeader();
    }
  }