@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRetainInstance(true); setHasOptionsMenu(true); EventBus.getDefault().register(this); getAccountTask = new GetAccountTask(getActivity(), username); getAccountTask.setTaskProcessCallback( null); // Disable default loading indicator, we have our own getAccountTask.execute(); getProfileFormDescriptionTask = new GetProfileFormDescriptionTask(getActivity()) { @Override protected void onSuccess(@NonNull FormDescription formDescription) throws Exception { EditUserProfileFragment.this.formDescription = formDescription; if (null != viewHolder) { setData(account, formDescription); } } }; getProfileFormDescriptionTask.setTaskProcessCallback(null); getProfileFormDescriptionTask.execute(); }
@Override public void onDestroy() { super.onDestroy(); getAccountTask.cancel(true); getProfileFormDescriptionTask.cancel(true); if (null != setAccountImageTask) { setAccountImageTask.cancel(true); } helper.deleteTemporaryFile(); EventBus.getDefault().unregister(this); }