1
0
mirror of https://github.com/TeamNewPipe/NewPipe.git synced 2024-11-26 13:02:34 +01:00

Merge pull request #5896 from Stypox/fix-error-panel

Fix error panel created in onViewCreated() but disposed in onDestroy()
This commit is contained in:
Tobi 2021-03-24 11:32:07 +01:00 committed by GitHub
commit fe43b4da39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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