Пример #1
0
 private static Building tryToLoadFromCache(File cache) {
   Building retval = null;
   try {
     if (cache.exists()) {
       long timestamp = System.nanoTime();
       Log.d(TAG, "started loading building from cache");
       retval = Building.fromCache(cache);
       Log.d(
           TAG,
           "building loaded from cache in "
               + (double) (System.nanoTime() - timestamp) / Math.pow(10, 9));
     }
   } catch (IOException e) {
     Log.e(TAG, "failed to load building from cache");
     e.printStackTrace();
   } catch (ClassNotFoundException e) {
     Log.e(TAG, "failed to load building from cache");
     e.printStackTrace();
   }
   return retval;
 }