mirror of
https://github.com/M66B/NetGuard.git
synced 2025-01-01 12:54:07 +00:00
Enable use hosts after download
This commit is contained in:
parent
6916fda17e
commit
ad9610cd43
1 changed files with 3 additions and 1 deletions
|
@ -266,6 +266,7 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
|
|||
prefs.edit().putString("hosts_last", last).apply();
|
||||
|
||||
if (running) {
|
||||
getPreferenceScreen().findPreference("use_hosts").setEnabled(true);
|
||||
pref_hosts_download.setSummary(getString(R.string.msg_download_last, last));
|
||||
Toast.makeText(ActivitySettings.this, R.string.msg_downloaded, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
@ -849,12 +850,13 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
|
|||
if (ex == null) {
|
||||
Toast.makeText(ActivitySettings.this, R.string.msg_completed, Toast.LENGTH_LONG).show();
|
||||
|
||||
getPreferenceScreen().findPreference("use_hosts").setEnabled(true);
|
||||
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ActivitySettings.this);
|
||||
prefs.edit().remove("hosts_last").apply();
|
||||
getPreferenceScreen().findPreference("hosts_download").setSummary(null);
|
||||
|
||||
SinkholeService.reload(null, "hosts", ActivitySettings.this);
|
||||
getPreferenceScreen().findPreference("use_hosts").setEnabled(true);
|
||||
} else
|
||||
Toast.makeText(ActivitySettings.this, ex.toString(), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue