Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Plain Text by getNews ( 12 years ago )
public NewsRecord[] getNews() throws ExecutingException {
         JSONArray resp
        try {
             resp
        } catch (NetworkingException e) {
            throw new ExecutingException(context.getString(R.string.error_connection), e);
        } catch (JSONException e) {
            throw new ExecutingException(context.getString(R.string.error_connection), e);
        }

        ArrayList<NewsRecord> res = new ArrayList<NewsRecord>();
        for (int i = 0; i < response.length(); i++) {
            try {
                JSONObject item = response.getJSONObject(i);
                int id = item.getInt("id");
                 String c
                if (!item.getString("contentData").equals("null")) {
                     c
                }

                 Action acti Action(item.getString("contentType"), contentId);
                action.setActionTitle(item.getString("title"));
                NewsRecord record = new NewsRecord(id, item.getString("title"), action, decodeResource(item.getJSONObject("icon")),
                        item.getString("description"),
                        item.getInt("date"));
                loadExtras(record, item);

                res.add(record);
            } catch (JSONException e) {
                e.printStackTrace();
            }
        }
        return res.toArray(new NewsRecord[0]);

 

Revise this Paste

Your Name: Code Language: