Skip to content

Instantly share code, notes, and snippets.

@Vatyx
Created May 2, 2016 08:27
Show Gist options
  • Save Vatyx/730e2943d50c9339ff6dc14b824030e5 to your computer and use it in GitHub Desktop.
Save Vatyx/730e2943d50c9339ff6dc14b824030e5 to your computer and use it in GitHub Desktop.
public void run() {
try {
String response = HttpRequest.post("http://ec2-52-38-4-62.us-west-2.compute.amazonaws.com/")
.contentType("application/json")
.accept("application/json")
.send("{\"hello\":\"" + concatStringsWSep(allTweets, " ") + "\"}")
.body();
final JSONObject what = new JSONObject(response);
url_done = what.getString("img");
runOnUiThread(new Runnable() {
@Override
public void run() {
try {
loadImageInView(what.getString("img"));
findViewById(R.id.progressBar).setVisibility(View.GONE);
} catch(Exception e) {
}
}
});
} catch (Exception e) {
System.out.println(e.toString());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment