Code example for Callable

Methods: call

0
			throw new RuntimeException("Main thread assertion failed");
	} 
	 
	public static <T> T callInMainThread(Callable<T> call) throws Exception {
		if (isMainThread()) 
			return call.call();
		else { 
			FutureTask<T> task = new FutureTask<T>(call);
			getHandler().post(task);
			return task.get();
		} 
	} 
}