Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ActivityCompat.recreate(). #5178

Merged

Conversation

Isira-Seneviratne
Copy link
Member

@Isira-Seneviratne Isira-Seneviratne commented Dec 15, 2020

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

  • Use ActivityCompat.recreate() to work around bugs in the platform recreate method on API levels below 28.

APK testing

debug.zip

Due diligence

@@ -31,7 +32,7 @@ public boolean onPreferenceChange(final Preference preference, final Object newV

if (!newValue.equals(startThemeKey) && getActivity() != null) {
// If it's not the current theme
getActivity().recreate();
ActivityCompat.recreate(requireActivity());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't recreate() also begin used in ServicePlayerActivity and MainActivity?

Copy link
Member Author

@Isira-Seneviratne Isira-Seneviratne Dec 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the only usage of recreate I found.

Edit: I found those usages you mentioned.

Copy link
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you!

@Stypox Stypox merged commit 276f50a into TeamNewPipe:dev Dec 15, 2020
@Isira-Seneviratne Isira-Seneviratne deleted the Use_ActivityCompat_recreate branch December 15, 2020 08:50
This was referenced Dec 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants