~xdavidwu/saf-sftp

44d8e23226dc363f4489beee2f3bb0dc2c13c0a0 — xdavidwu 2 years ago cf2d956
MainActivity: connection test: block ui when connecting
1 files changed, 4 insertions(+), 0 deletions(-)

M src/main/java/org/safsftp/MainActivity.java
M src/main/java/org/safsftp/MainActivity.java => src/main/java/org/safsftp/MainActivity.java +4 -0
@@ 1,6 1,7 @@
package org.safsftp;

import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.net.Uri;


@@ 115,6 116,8 @@ public class MainActivity extends PreferenceActivity implements OnSharedPreferen
			Connection connection = new Connection(
				settings.getString("host", ""),
				Integer.parseInt(settings.getString("port", "22")));
			ProgressDialog pd = ProgressDialog.show(MainActivity.this,
				"Connection test", "Connecting.");
			AsyncTask.execute(() -> {
				String result = "Succeeded.";
				try {


@@ 136,6 139,7 @@ public class MainActivity extends PreferenceActivity implements OnSharedPreferen
						.setMessage(message)
						.setPositiveButton("OK", null)
						.show();
					pd.dismiss();
				});
			});
			return true;