Code example for Callable

Methods: call

0
      // If it throws an exception, capture that exception 
      // and rethrow it later. 
      handler.post(new Runnable() {
        public void run() { 
          try { 
            c.call();
          } catch (Exception e) {
            exceptions[0] = e;
          } finally { 
            latch.countDown();
          } 
        } 
      }); 
 
      // Wait for onSuccess to finish 
      latch.await();
 
      if (exceptions[0] != null) throw exceptions[0];
    } 
  } 
}