-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Replace the System.exit calls with getActivity.finishAffinity() #6495
Replace the System.exit calls with getActivity.finishAffinity() #6495
Conversation
Thanks for making a PR! Please avoid putting the issue number in the PR title. |
Note that the "APK testing" section is for putting a link to the APK (from the "Checks" tab of the PR; the APK isn't there currently because you're a first-time contributor so a maintainer has to manually approve the checks to be run), not for how you tested it yourself. |
Apologies for "Apk Testing" section I will remember this in future :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a bunch of minor nits.
app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also rewrite the commit messages to have a short summary with less than 70 characters followed by an optinal body with further descriptions/explanations.
If you look at the commits on github, you can see that they are cut off. https://github.com/TeamNewPipe/NewPipe/pull/6495/commits
@XiangRongLin I think we can just squash the commits when we merge this and add our own summary, so no worries there |
That would need to be done by him, because otherwise i think it counts the contribution towards the one squashing and merging it and not the PR opener |
oh I just noticed, the context param is not required. Activity and FragmentActivity(returned from requireActivity) are derived from Context java.lang.Object java.lang.Object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
let me know if all is good then I will squash the commit messages. |
yes, all good, go ahead please |
Should be sorted now |
I still see 9 commits. Looks like the squashing did not work. Can you try again @danielmbutler ? |
Hi Guys I've been trying to squash my previous commits but it seems to merge them all together and then commit the merge on top of previous commits, not sure what I'm doing wrong |
Implemented "RestartApp" method defined in NavigationHelper.java. This method is used in ExitActivity.java and ContentSettingsFragment.java
3489c48
to
90de759
Compare
After multiple tries, I figured it out lol |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect, thank you!
Replaced System.exit call with finishAffinity() and start MainActivity call, tested by changing some settings values, exporting my configuration, reversing the changes, and then reimporting the settings, once the MainActivity was restarted I could then see my chosen settings imported.
Also updated ExitActivity.java to remove System.Exit call and replace with start MainActivity
What is it?
Description of the changes in your PR
Replaced System.Exit calls with getActivity.finishAffinity() in the below 2 files
Fixes the following issue(s)
APK testing
I ran the APK on an emulator and went through the settings flow and ensured that my changes persisted after the importing task had finished and the app was restarted.
Due diligence