diff options
author | Nick Knudson <nickaknudson@gmail.com> | 2013-10-11 13:45:13 -0700 |
---|---|---|
committer | Nick Knudson <nickaknudson@gmail.com> | 2013-10-11 13:45:13 -0700 |
commit | 160a990c697efbd17733c15c8d8f24cfc0d0e93d (patch) | |
tree | 766e3fad5e69fb095aa3246b0211d7964bcf7c59 /README.md | |
parent | 28969da188e66c3596b06d8a5e383def4ce80526 (diff) | |
download | AndroidAsync-160a990c697efbd17733c15c8d8f24cfc0d0e93d.tar.gz AndroidAsync-160a990c697efbd17733c15c8d8f24cfc0d0e93d.tar.bz2 AndroidAsync-160a990c697efbd17733c15c8d8f24cfc0d0e93d.zip |
updated README to document JSONArrays
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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
|