1
0
mirror of http://galexander.org/git/simplesshd.git synced 2024-12-29 09:28:07 +00:00

fix getting the port number out of the UI

This commit is contained in:
Greg Alexander 2014-12-16 16:50:05 -05:00
parent 41faa118cc
commit c6fbf0cbcc

View File

@ -73,7 +73,12 @@ public class SimpleSSHD extends Activity
SharedPreferences.Editor edit = prefs.edit(); SharedPreferences.Editor edit = prefs.edit();
boolean b = onboot_view.isChecked(); boolean b = onboot_view.isChecked();
if (b != get_onboot(prefs)) { edit.putBoolean("onboot", b); } if (b != get_onboot(prefs)) { edit.putBoolean("onboot", b); }
int i = Integer.valueOf(onboot_view.getText().toString()); int i;
try {
i = Integer.valueOf(port_view.getText().toString());
} catch (Exception e) {
i = 0;
}
if (i != get_port(prefs)) { edit.putInt("port", i); } if (i != get_port(prefs)) { edit.putInt("port", i); }
String s = path_view.getText().toString(); String s = path_view.getText().toString();
if (!s.equals(get_path(prefs))) { edit.putString("path", s); } if (!s.equals(get_path(prefs))) { edit.putString("path", s); }