Created
January 30, 2016 12:26
-
-
Save codemilli/ea04430d7a166da1c8ac to your computer and use it in GitHub Desktop.
Async Task with JSON Api request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private class RestApi extends AsyncTask<String, Void, JSONObject> { | |
@Override | |
protected JSONObject doInBackground(String... params) { | |
return this.GET(params[0]); | |
} | |
@Override | |
protected void onPostExecute(JSONObject jsonObject) { | |
super.onPostExecute(jsonObject); | |
this.onReceived(jsonObject); | |
} | |
protected abstract void onReceived(JSONObject json); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment