@Override public void onSuccess(List<TransitLPActivity> result) { if (result != null) { System.out.println("Unit"); ActivityRecord[] records; List<ActivityRecord> listRecords = new ArrayList<ActivityRecord>(); for (TransitLPActivity activity : result) { if (activity.getCategory().equals(transitCategory.getId())) { listRecords.add(new ActivityRecord(activity)); System.out.println( "activity found unit : " + activity.getName() + " id " + activity.getId()); if (!activity.getId().equals("")) takenActivities.add(activity.getId()); } } records = new ActivityRecord[listRecords.size()]; records = listRecords.toArray(records); view.addExistingUnitChoice(unitId, records); } fetcherReady(); }
@Override public void onSuccess(ArrayList<TransitLPActivity> result) { if (result != null) { ActivityRecord[] records; List<ActivityRecord> listRecords = new ArrayList<ActivityRecord>(); for (TransitLPActivity activity : result) { if (activity.getCategory().equals(transitCategory.getId())) { System.out.println("activity found " + activity.getName()); listRecords.add(new ActivityRecord(activity)); if (!activity.getSchemaID().equals("")) takenActivities.add(activity.getSchemaID()); } } records = new ActivityRecord[listRecords.size()]; records = listRecords.toArray(records); view.setProjectActivities(records); System.out.println("FetchProjectActivites"); new FetchProjectActivityUnits(); } else { System.err.println("Error while fetching project activities"); } }