Code example for TimeoutException

0
    if (this.mException != null) {
      throw new ExecutionException(this.mException);
    } 
 
    if (!this.mResultReceived) {
      throw new TimeoutException();
    } 
 
    return this.mResult;
  } 
 
  @Override 
  public boolean isCancelled() { 
 
    if (this.mRequest == null) {
      return false; 
    } 
    return this.mRequest.isCanceled();
  } 
 
  @Override