runOnUiThread() wants a Runnable, not a Thread, but i don't think it

matters.  anyways, re-factored while i was there.
sigsegv_dump
Greg Alexander 6 years ago
parent f1c8faad21
commit c4e32e3ddc

@ -134,21 +134,22 @@ public class SimpleSSHD extends Activity
} }
} }
public static void update_startstop() { private static void run_on_ui(Runnable r) {
Thread t = new Thread() {
public void run() {
synchronized (lock) { synchronized (lock) {
if (curr != null) { if (curr != null) {
curr.update_startstop_prime(); curr.runOnUiThread(r);
} }
} }
} }
};
public static void update_startstop() {
run_on_ui(new Runnable() { public void run() {
synchronized (lock) { synchronized (lock) {
if (curr != null) { if (curr != null) {
curr.runOnUiThread(t); curr.update_startstop_prime();
} }
} }
} });
} }
public void startstop_clicked(View v) { public void startstop_clicked(View v) {
@ -199,20 +200,13 @@ public class SimpleSSHD extends Activity
} }
public static void update_log() { public static void update_log() {
Thread t = new Thread() { run_on_ui(new Runnable() { public void run() {
public void run() {
synchronized (lock) { synchronized (lock) {
if (curr != null) { if (curr != null) {
curr.update_log_prime(); curr.update_log_prime();
} }
} }
} } });
};
synchronized (lock) {
if (curr != null) {
curr.runOnUiThread(t);
}
}
} }
public static String get_ip(boolean pretty) { public static String get_ip(boolean pretty) {

Loading…
Cancel
Save