Show system DNS as hint text

This commit is contained in:
M66B 2016-01-26 20:51:56 +01:00
parent c6658c8531
commit 05025a575d
2 changed files with 3 additions and 4 deletions

View File

@ -199,8 +199,8 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
});
}
Preference pref_dns = screen.findPreference("dns");
pref_dns.setSummary(Util.getDefaultDNS(this));
EditTextPreference pref_dns = (EditTextPreference) screen.findPreference("dns");
pref_dns.getEditText().setHint(Util.getDefaultDNS(this));
// Handle technical info
Preference.OnPreferenceClickListener listener = new Preference.OnPreferenceClickListener() {
@ -463,8 +463,6 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
SinkholeService.reload(null, "changed " + name, this);
else if ("dns".equals(name)) {
if (TextUtils.isEmpty(prefs.getString(name, "")))
prefs.edit().remove(name).apply();
if (prefs.getBoolean("filter", false))
SinkholeService.reload(null, "changed " + name, this);
}

View File

@ -160,6 +160,7 @@
android:title="Native log level" />
<EditTextPreference
android:defaultValue=""
android:dependency="filter"
android:inputType="text"
android:key="dns"
android:title="DNS" />