Fix error panel created in onViewCreated() but disposed in onDestroy()

This commit is contained in:
Stypox 2021-03-24 09:27:17 +01:00
parent c7efa8c4f1
commit 0277b94b37
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23
1 changed files with 8 additions and 6 deletions

View File

@ -56,12 +56,6 @@ public abstract class BaseStateFragment<I> extends BaseFragment implements ViewC
}
}
@Override
public void onDestroy() {
super.onDestroy();
errorPanelHelper.dispose();
}
/*//////////////////////////////////////////////////////////////////////////
// Init
//////////////////////////////////////////////////////////////////////////*/
@ -74,6 +68,14 @@ public abstract class BaseStateFragment<I> extends BaseFragment implements ViewC
errorPanelHelper = new ErrorPanelHelper(this, rootView, this::onRetryButtonClicked);
}
@Override
public void onDestroyView() {
super.onDestroyView();
if (errorPanelHelper != null) {
errorPanelHelper.dispose();
}
}
protected void onRetryButtonClicked() {
reloadContent();
}