Avoid crash when resuming the application

This commit is contained in:
Gautier Pelloux-Prayer 2014-07-16 14:22:16 +02:00
parent c66d9328fd
commit 25d4b0c670

View file

@ -218,10 +218,12 @@ public class SettingsFragment extends PreferencesListFragment implements EcCalib
}
private void setPreferenceDefaultValueAndSummary(int pref, String value) {
if(value != null) {
EditTextPreference etPref = (EditTextPreference) findPreference(getString(pref));
etPref.setText(value);
etPref.setSummary(value);
}
}
private void initTunnelSettings() {
setPreferenceDefaultValueAndSummary(R.string.pref_tunnel_host_key, mPrefs.getTunnelHost());