@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(List<TransitLPPot<TransitLPActivity>> result) { if (result != null) { ActivityRecord[] records; List<ActivityRecord> listRecords = new ArrayList<ActivityRecord>(); for (TransitLPPot<TransitLPActivity> pot : result) { for (TransitLPActivity activity : pot.getStoredEntities()) { if (activity.getCategory().equals(transitCategory.getId()) && !takenActivities.contains(activity.getId())) listRecords.add(new ActivityRecord(activity)); } } records = new ActivityRecord[listRecords.size()]; records = listRecords.toArray(records); view.setSchemaActivities(records); view.addNewUnitChoice(); System.out.println("FetchSchemaActivities"); fireDisplayReady(); } else System.err.println("Error Fetching activities"); }