mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 17:46:37 +03:00
Review of calls to super. in Activity/Fragment life cycle methods
This commit is contained in:
parent
423ac76702
commit
733c8147ad
12 changed files with 16 additions and 13 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -147,8 +147,8 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
|
|||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
leaveTransferProgress();
|
||||
super.onStop();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -164,8 +164,8 @@ public class FileDownloadFragment extends FileFragment implements OnClickListene
|
|||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
leaveTransferProgress();
|
||||
super.onStop();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -269,9 +269,9 @@ ViewPager.OnPageChangeListener, OnRemoteOperationListener {
|
|||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
unregisterReceiver(mDownloadFinishReceiver);
|
||||
mDownloadFinishReceiver = null;
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -294,10 +294,10 @@ public class PreviewImageFragment extends FileFragment {
|
|||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (mBitmap != null) {
|
||||
mBitmap.recycle();
|
||||
}
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue