Code example for URLConnection

Methods: setRequestProperty

0
        } 
 
        @Override 
        public Object getContent(URLConnection connection) throws IOException {
            connection
                    .setRequestProperty("Cache-Control", "max-age=" + mMaxAge);
            return super.getContent(connection);
        } 
 
        @Override 
        protected Object getContent(String json) throws JSONException {
            JSONArray photos = FlickrUtil.parsePhotos(json);
 
            for (int i = 0; i < photos.length(); i++) {
                JSONObject photo = photos.getJSONObject(i);
                MatrixCursor.RowBuilder builder = mOutput.newRow();
                for (String columnName : mOutput.getColumnNames()) {
                    builder.add(photo.optString(mProjectionMap.get(columnName)));
                } 
            } 
Contextual code suggestions in your IDE  Get Codota for Java