@Override public void onDestroy() { super.onDestroy(); Log.i(TAG, "onDestroy"); final FragmentActivity activity = getActivity(); if (activity != null && mConnection != null && connect) { try { activity.unbindService(mConnection); } catch (Exception e) { } } }
@Override public void onStop() { Log.i(getClass().getName(), "onStop"); super.onStop(); if (recordingServiceInterface.recordingState() == RecordingService.STATE_STOPPED) { activity.stopService(recordingService); } unregisterService(); activity.unbindService(recordingServiceConnection); cancelTimer(); }