Exemplo n.º 1
0
 private void doIndexing(List<Friend> list) {
   Integer index = 1;
   for (Friend friend : list) {
     friend.setIndex(index.toString());
     ++index;
   }
 }
Exemplo n.º 2
0
    private Friend parseFriends(JSONObject json) {

      try {
        String name = json.getString(Friend_Name);
        String points = json.getString(Weekly_Points);
        String url = json.getString(PIC_URL);

        Friend friend = new Friend();
        friend.setName(name);
        friend.setURL(url);
        friend.setWeekly_points(points);
        return friend;

      } catch (JSONException e) {
        return null;
      }
    }