@Override public void onDestroy() { // disconnect if we are connected if (subspace.isConnected()) { try { subspace.SSDisconnect(); } catch (IOException ioe) { Log.e(TAG, Log.getStackTraceString(ioe)); } } notification.cancel(); // Tell the user we stopped. Toast.makeText(this, R.string.network_service_stopped, Toast.LENGTH_SHORT).show(); }