Code example for JSONObject

Methods: getInt

0
  private void sortVersions() { 
    Collections.sort(sortedVersions, new Comparator<JSONObject>() {
      @Override 
      public int compare(JSONObject object1, JSONObject object2) {
        try { 
          if (object1.getInt("version") > object2.getInt("version")) {
            return 0; 
          } 
        } 
        catch (JSONException e) {
        } 
 
        return 0; 
      } 
    }); 
  } 
 
  public int getCount() { 
    return 2 * sortedVersions.size();
  }