~xdavidwu/saf-sftp

76a33db92f5c5a5f844f26d8bbeb2f25fabf2c4f — xdavidwu 5 years ago 7e9fe5b
show configured values on create
1 files changed, 11 insertions(+), 3 deletions(-)

M src/main/java/org/safsftp/MainActivity.java
M src/main/java/org/safsftp/MainActivity.java => src/main/java/org/safsftp/MainActivity.java +11 -3
@@ 27,9 27,17 @@ public class MainActivity extends PreferenceActivity
		usernameText=(EditTextPreference)findPreference("username");
		passwdText=(EditTextPreference)findPreference("passwd");

		getPreferenceScreen().getSharedPreferences()
			.registerOnSharedPreferenceChangeListener(this);
	}
		SharedPreferences settings=getPreferenceScreen().getSharedPreferences();
		settings.registerOnSharedPreferenceChangeListener(this);
		if (!settings.getString("host", "").equals(""))
			hostText.setSummary(settings.getString("host", ""));
		if (!settings.getString("port", "").equals(""))
			portText.setSummary(settings.getString("port", ""));
		if (!settings.getString("username", "").equals(""))
			usernameText.setSummary(settings.getString("username", ""));
		if (!settings.getString("passwd", "").equals(""))
			passwdText.setSummary(getString(R.string.passwd_filled));
}

	@Override
	public void onSharedPreferenceChanged(SharedPreferences settings,