Showing the changes to app/src/main/java/org/echoline/drawterm/DrawTermThread.java (1 of 1765 files). Show all
Unified · Split
| @@ -0,0 +1,33 @@ | ||
| 1 | +package org.echoline.drawterm; | |
| 2 | + | |
| 3 | +import android.support.design.widget.Snackbar; | |
| 4 | + | |
| 5 | +/** | |
| 6 | + * Created by eli on 12/4/17. | |
| 7 | + */ | |
| 8 | + | |
| 9 | +public class DrawTermThread extends Thread { | |
| 10 | + MainActivity m; | |
| 11 | + String c, a, u, p; | |
| 12 | + | |
| 13 | + public DrawTermThread(String c, String a, String u, String p, MainActivity m) { | |
| 14 | + this.c = c; | |
| 15 | + this.a = a; | |
| 16 | + this.u = u; | |
| 17 | + this.p = p; | |
| 18 | + this.m = m; | |
| 19 | + } | |
| 20 | + | |
| 21 | + @Override | |
| 22 | + public void run() { | |
| 23 | + String args[] = {"drawterm", "-p", "-h", c, "-a", a, "-u", u}; | |
| 24 | + m.setPass(p); | |
| 25 | + m.dtmain(args); | |
| 26 | + m.runOnUiThread(new Runnable() { | |
| 27 | + @Override | |
| 28 | + public void run() { | |
| 29 | + m.setContentView(R.layout.server_main); | |
| 30 | + } | |
| 31 | + }); | |
| 32 | + } | |
| 33 | +} | |