mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-11-19 00:04:56 +00:00
Code refactoring, PR changes.
This commit is contained in:
parent
939cc56951
commit
ad5535af81
@ -70,7 +70,6 @@ public class CheckForNewAppVersionTask extends AsyncTask<Void, Void, String> {
|
||||
protected String doInBackground(Void... voids) {
|
||||
|
||||
// Make a network request to get latest NewPipe data.
|
||||
|
||||
if (client == null) {
|
||||
|
||||
client = new OkHttpClient
|
||||
@ -84,10 +83,8 @@ public class CheckForNewAppVersionTask extends AsyncTask<Void, Void, String> {
|
||||
.build();
|
||||
|
||||
try {
|
||||
|
||||
Response response = client.newCall(request).execute();
|
||||
return response.body().string();
|
||||
|
||||
} catch (IOException ex) {
|
||||
ErrorActivity.reportError(app, ex, null, null,
|
||||
ErrorActivity.ErrorInfo.make(UserAction.SOMETHING_ELSE, "none",
|
||||
|
@ -23,14 +23,11 @@ public class UpdateSettingsFragment extends BasePreferenceFragment {
|
||||
}
|
||||
|
||||
private Preference.OnPreferenceChangeListener updatePreferenceChange
|
||||
= new Preference.OnPreferenceChangeListener() {
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
= (preference, newValue) -> {
|
||||
|
||||
defaultPreferences.edit().putBoolean(getString(R.string.update_app_key),
|
||||
(boolean) newValue).apply();
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user