diff options
author | Andy Doan <andy.doan@linaro.org> | 2011-10-24 19:56:21 -0500 |
---|---|---|
committer | Andy Doan <andy.doan@linaro.org> | 2011-10-24 19:56:21 -0500 |
commit | b48178ab6a957a62f2666fc0e6b8198c11ab9ac6 (patch) | |
tree | 3e59abd0d748864c3a6e9bc191a36a857a217e52 | |
parent | 6611282590dc693b546923936166c8eaddd0bee0 (diff) | |
download | LinaroConnect-b48178ab6a957a62f2666fc0e6b8198c11ab9ac6.tar.gz |
update setJsonURL function to set cache name
make this function automatically set the cache file name if one
is not already done
-rw-r--r-- | src/org/linaro/connect/CachedJSONLayoutAdapter.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/org/linaro/connect/CachedJSONLayoutAdapter.java b/src/org/linaro/connect/CachedJSONLayoutAdapter.java index bba57bd..da845b9 100644 --- a/src/org/linaro/connect/CachedJSONLayoutAdapter.java +++ b/src/org/linaro/connect/CachedJSONLayoutAdapter.java @@ -44,8 +44,16 @@ public abstract class CachedJSONLayoutAdapter extends ArrayAdapter<JSONItem> { mCacheFile = file; } + /** + * Sets the url to grab the data from. If no cache file name is set, then + * it will use the basename of the url + */ protected void setJSONUrl(String url) { mJSONUrl = url; + if( mCacheFile == null ) { + String parts[] = url.split("/"); + mCacheFile = parts[parts.length-1]; + } } /** |