Review of calls to super. in Activity/Fragment life cycle methods

This commit is contained in:
David A. Velasco 2014-05-19 11:56:29 +02:00
parent 423ac76702
commit 733c8147ad
12 changed files with 16 additions and 13 deletions

View file

@ -82,10 +82,10 @@ public class FileObserverService extends Service {
@Override
public void onDestroy() {
super.onDestroy();
unregisterReceiver(mDownloadReceiver);
mObserversMap = null; // TODO study carefully the life cycle of Services to grant the best possible observance
Log_OC.d(TAG, "Bye, bye");
super.onDestroy();
}

View file

@ -218,6 +218,7 @@ public class MediaService extends Service implements OnCompletionListener, OnPre
*/
@Override
public void onCreate() {
super.onCreate();
Log_OC.d(TAG, "Creating ownCloud media service");
mWifiLock = ((WifiManager) getSystemService(Context.WIFI_SERVICE)).
@ -637,6 +638,7 @@ public class MediaService extends Service implements OnCompletionListener, OnPre
mState = State.STOPPED;
releaseResources(true);
giveUpAudioFocus();
super.onDestroy();
}

View file

@ -172,10 +172,10 @@ public class OperationsService extends Service {
@Override
public void onDestroy() {
//Log_OC.wtf(TAG, "onDestroy init" );
super.onDestroy();
//Log_OC.wtf(TAG, "Clear mUndispatchedFinisiedOperations" );
mUndispatchedFinishedOperations.clear();
//Log_OC.wtf(TAG, "onDestroy end" );
super.onDestroy();
}

View file

@ -89,7 +89,6 @@ public class AccountSelectActivity extends SherlockListActivity implements
@Override
protected void onPause() {
super.onPause();
if (this.isFinishing()) {
Account current = AccountUtils.getCurrentOwnCloudAccount(this);
if ((mPreviousAccount == null && current != null) ||
@ -102,6 +101,7 @@ public class AccountSelectActivity extends SherlockListActivity implements
startActivity(i);
}
}
super.onPause();
}
@Override

View file

@ -204,7 +204,6 @@ implements OnRemoteOperationListener, ComponentsGetter {
@Override
protected void onDestroy() {
super.onDestroy();
if (mOperationsServiceConnection != null) {
unbindService(mOperationsServiceConnection);
mOperationsServiceBinder = null;
@ -217,6 +216,7 @@ implements OnRemoteOperationListener, ComponentsGetter {
unbindService(mUploadServiceConnection);
mUploadServiceConnection = null;
}
super.onDestroy();
}

View file

@ -261,10 +261,10 @@ public class Preferences extends SherlockPreferenceActivity {
@Override
protected void onResume() {
super.onResume();
SharedPreferences appPrefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
boolean state = appPrefs.getBoolean("set_pincode", false);
pCode.setChecked(state);
super.onResume();
}
@Override

View file

@ -69,6 +69,6 @@ public class LoadingDialog extends DialogFragment {
public void onDestroyView() {
if (getDialog() != null && getRetainInstance())
getDialog().setDismissMessage(null);
super.onDestroyView();
super.onDestroyView();
}
}

View file

@ -147,8 +147,8 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
@Override
public void onStop() {
super.onStop();
leaveTransferProgress();
super.onStop();
}

View file

@ -164,8 +164,8 @@ public class FileDownloadFragment extends FileFragment implements OnClickListene
@Override
public void onStop() {
super.onStop();
leaveTransferProgress();
super.onStop();
}
@Override

View file

@ -269,9 +269,9 @@ ViewPager.OnPageChangeListener, OnRemoteOperationListener {
@Override
public void onPause() {
super.onPause();
unregisterReceiver(mDownloadFinishReceiver);
mDownloadFinishReceiver = null;
super.onPause();
}

View file

@ -294,10 +294,10 @@ public class PreviewImageFragment extends FileFragment {
@Override
public void onDestroy() {
super.onDestroy();
if (mBitmap != null) {
mBitmap.recycle();
}
super.onDestroy();
}

View file

@ -457,8 +457,8 @@ public class PreviewMediaFragment extends FileFragment implements
@Override
public void onPause() {
super.onPause();
Log_OC.e(TAG, "onPause");
super.onPause();
}
@Override
@ -469,14 +469,13 @@ public class PreviewMediaFragment extends FileFragment implements
@Override
public void onDestroy() {
super.onDestroy();
Log_OC.e(TAG, "onDestroy");
super.onDestroy();
}
@Override
public void onStop() {
Log_OC.e(TAG, "onStop");
super.onStop();
mPrepared = false;
if (mMediaServiceConnection != null) {
@ -488,6 +487,8 @@ public class PreviewMediaFragment extends FileFragment implements
mMediaServiceConnection = null;
mMediaServiceBinder = null;
}
super.onStop();
}
@Override