Source:
protected void onResume() { super.onResume(); if (!areStoragePermissionsGranted(this)) { onResumeWasCalledWithoutPermissions = true; return; } if (questionFontSize != Collect.getQuestionFontsize()) { questionFontSize = Collect.getQuestionFontsize(); refreshCurrentView(); } String navigation = (String) GeneralSharedPreferences.getInstance().get(GeneralKeys.KEY_NAVIGATION); showNavigationButtons = navigation.contains(GeneralKeys.NAVIGATION_BUTTONS); findViewById(R.id.buttonholder).setVisibility(showNavigationButtons ? View.VISIBLE : View.GONE); findViewById(R.id.shadow_up).setVisibility(showNavigationButtons ? View.VISIBLE : View.GONE); if (showNavigationButtons) { updateNavigationButtonVisibility(); } if (errorMessage != null) { if (alertDialog != null && !alertDialog.isShowing()) { createErrorDialog(errorMessage, EXIT); } else { return; } } FormController formController = getFormController(); if (formLoaderTask != null) { formLoaderTask.setFormLoaderListener(this); if (formController == null && formLoaderTask.getStatus() == AsyncTask.Status.FINISHED) { FormController fec = formLoaderTask.getFormController(); if (fec != null) { if (!readPhoneStatePermissionRequestNeeded) { loadingComplete(formLoaderTask, formLoaderTask.getFormDef(), null); } } else { dismissFormLoadingDialogFragment(); FormLoaderTask t = formLoaderTask; formLoaderTask = null; t.cancel(true); t.destroy(); startActivity(new Intent(this, MainMenuActivity.class)); } } } else { if (formController == null) { startActivity(new Intent(this, MainMenuActivity.class)); finish(); return; } } if (saveToDiskTask != null) { saveToDiskTask.setFormSavedListener(this); } }

Target:
protected void onResume() { super.onResume(); if (!areStoragePermissionsGranted(this)) { onResumeWasCalledWithoutPermissions = true; return; } adjustFontSize(); String navigation = (String) GeneralSharedPreferences.getInstance().get(GeneralKeys.KEY_NAVIGATION); showNavigationButtons = navigation.contains(GeneralKeys.NAVIGATION_BUTTONS); findViewById(R.id.buttonholder).setVisibility(showNavigationButtons ? View.VISIBLE : View.GONE); findViewById(R.id.shadow_up).setVisibility(showNavigationButtons ? View.VISIBLE : View.GONE); if (showNavigationButtons) { updateNavigationButtonVisibility(); } if (errorMessage != null) { if (alertDialog != null && !alertDialog.isShowing()) { createErrorDialog(errorMessage, EXIT); } else { return; } } FormController formController = getFormController(); if (formLoaderTask != null) { formLoaderTask.setFormLoaderListener(this); if (formController == null && formLoaderTask.getStatus() == AsyncTask.Status.FINISHED) { FormController fec = formLoaderTask.getFormController(); if (fec != null) { if (!readPhoneStatePermissionRequestNeeded) { loadingComplete(formLoaderTask, formLoaderTask.getFormDef(), null); } } else { dismissFormLoadingDialogFragment(); FormLoaderTask t = formLoaderTask; formLoaderTask = null; t.cancel(true); t.destroy(); startActivity(new Intent(this, MainMenuActivity.class)); } } } else { if (formController == null) { startActivity(new Intent(this, MainMenuActivity.class)); finish(); return; } } if (saveToDiskTask != null) { saveToDiskTask.setFormSavedListener(this); } }