Skip to content

Commit

Permalink
Merge pull request TeamNewPipe/NewPipe#5896 from Stypox/fix-error-panel
Browse files Browse the repository at this point in the history
Fix error panel created in onViewCreated() but disposed in onDestroy()
  • Loading branch information
TobiGr authored and tossj committed Apr 22, 2021
1 parent b2f765f commit ec8feb9
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ public void onResume() {
}
}

@Override
public void onDestroy() {
super.onDestroy();
errorPanelHelper.dispose();
}

/*//////////////////////////////////////////////////////////////////////////
// Init
//////////////////////////////////////////////////////////////////////////*/
Expand All @@ -74,6 +68,14 @@ protected void initViews(final View rootView, final Bundle savedInstanceState) {
errorPanelHelper = new ErrorPanelHelper(this, rootView, this::onRetryButtonClicked);
}

@Override
public void onDestroyView() {
super.onDestroyView();
if (errorPanelHelper != null) {
errorPanelHelper.dispose();
}
}

protected void onRetryButtonClicked() {
reloadContent();
}
Expand Down

0 comments on commit ec8feb9

Please sign in to comment.