Code example for URL

Methods: getContent

0
		 
		@SuppressWarnings("unchecked") 
		final protected boolean loadUrl(String url) {
			mUrl = url;
			try { 
				URL request = new URL(mUrl);
				String jsonRaw = Common.getContent((InputStream) request.getContent());
				JSONArray collection = new JSONArray(jsonRaw);
				for (int i = 0; i < collection.length(); i++) {
					if (isCancelled()) {
						return false; 
					} 
					try { 
						publishProgress(activity.loadJSON(collection.getJSONObject(i)));
					} catch (JSONException e) {
					} 
				} 
				return true; 
			} catch (Exception e) {
				activity.setException(e);
			}