Skip to content

Instantly share code, notes, and snippets.

@ducalpha
Created August 19, 2013 04:46
Show Gist options
  • Save ducalpha/6265841 to your computer and use it in GitHub Desktop.
Save ducalpha/6265841 to your computer and use it in GitHub Desktop.
Multithreading in android
public static void start(int streamingMode) {
new Thread(new GproxyStart(streamingMode)).start();
}
private static class GproxyStart implements Runnable {
int streamingMode;
public GproxyStart(int streamingMode) {
this.streamingMode = streamingMode;
}
public void run() {
String gproxy_path;
if (streamingMode == VideoStreaming.GB_E_MODE) {
gproxy_path = SX_PATH;
} else if (streamingMode == VideoStreaming.GB_P_MODE) {
gproxy_path = SP_PATH;
} else {
/* someting wrong */
gproxy_path = SP_PATH;
}
int pty_pid = Utils.executeSu(gproxy_path);
Exec.waitFor(pty_pid);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment