aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorNick Knudson <nickaknudson@gmail.com>2013-10-11 13:45:13 -0700
committerNick Knudson <nickaknudson@gmail.com>2013-10-11 13:45:13 -0700
commit160a990c697efbd17733c15c8d8f24cfc0d0e93d (patch)
tree766e3fad5e69fb095aa3246b0211d7964bcf7c59 /README.md
parent28969da188e66c3596b06d8a5e383def4ce80526 (diff)
downloadAndroidAsync-160a990c697efbd17733c15c8d8f24cfc0d0e93d.tar.gz
AndroidAsync-160a990c697efbd17733c15c8d8f24cfc0d0e93d.tar.bz2
AndroidAsync-160a990c697efbd17733c15c8d8f24cfc0d0e93d.zip
updated README to document JSONArrays
Diffstat (limited to 'README.md')
-rw-r--r--README.md16
1 files changed, 16 insertions, 0 deletions
diff --git a/README.md b/README.md
index 9f7a760..d0004b2 100644
--- a/README.md
+++ b/README.md
@@ -65,7 +65,23 @@ AsyncHttpClient.getDefaultInstance().getJSONObject(url, new AsyncHttpClient.JSON
});
```
+Or for JSONArrays...
+```java
+// url is the URL to download. The callback will be invoked on the UI thread
+// once the download is complete.
+AsyncHttpClient.getDefaultInstance().getJSONArray(url, new AsyncHttpClient.JSONArrayCallback() {
+ // Callback is invoked with any exceptions/errors, and the result, if available.
+ @Override
+ public void onCompleted(Exception e, AsyncHttpResponse response, JSONArray result) {
+ if (e != null) {
+ e.printStackTrace();
+ return;
+ }
+ System.out.println("I got a JSONArray: " + result);
+ }
+});
+```
### Download a url to a file