Esempio n. 1
0
  public static void export(String dir) {
    List<DataSavable> list = getDataToLoad();

    for (DataSavable data : list) {
      data.export(dir);
    }
  }
Esempio n. 2
0
 public static boolean loadAll(Context ctx) {
   Data.loadedSuccesfully = true;
   List<DataSavable> list = getDataToLoad();
   for (DataSavable data : list) {
     try {
       data.load(ctx);
       Log.i(LOG_TAG, "Correctly loaded: " + data.getClass().getName());
     } catch (DataCorruptedException e) {
       if (data.onLoadingFailed(e)) {
         Data.loadedSuccesfully = false;
       }
       Log.d(LOG_TAG, "Warning: " + data.getClass().getName());
       Log.d(LOG_TAG, e.inspectError());
     } catch (IOError e) {
       if (data.onLoadingError(e)) {
         Data.loadedSuccesfully = false;
       }
       Log.e(LOG_TAG, "Fatal IO Error: " + data.getClass().getName(), e);
     }
   }
   return Data.loadedSuccesfully;
 }