roboguice.util
Class SafeAsyncTask.Task<ResultT>

java.lang.Object
  extended by roboguice.util.SafeAsyncTask.Task<ResultT>
All Implemented Interfaces:
Callable<Void>
Enclosing class:
SafeAsyncTask<ResultT>

public static class SafeAsyncTask.Task<ResultT>
extends Object
implements Callable<Void>


Field Summary
protected  android.os.Handler handler
           
protected  SafeAsyncTask<ResultT> parent
           
 
Constructor Summary
SafeAsyncTask.Task(SafeAsyncTask<ResultT> parent)
           
 
Method Summary
 Void call()
           
protected  ResultT doCall()
           
protected  void doException(Exception e)
           
protected  void doFinally()
           
protected  void doPreExecute()
           
protected  void doSuccess(ResultT r)
           
protected  void doThrowable(Throwable e)
           
protected  void postToUiThreadAndWait(Callable c)
          Posts the specified runnable to the UI thread using a handler, and waits for operation to finish.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

protected SafeAsyncTask<ResultT> parent

handler

protected android.os.Handler handler
Constructor Detail

SafeAsyncTask.Task

public SafeAsyncTask.Task(SafeAsyncTask<ResultT> parent)
Method Detail

call

public Void call()
          throws Exception
Specified by:
call in interface Callable<Void>
Throws:
Exception

doPreExecute

protected void doPreExecute()
                     throws Exception
Throws:
Exception

doCall

protected ResultT doCall()
                  throws Exception
Throws:
Exception

doSuccess

protected void doSuccess(ResultT r)
                  throws Exception
Throws:
Exception

doException

protected void doException(Exception e)
                    throws Exception
Throws:
Exception

doThrowable

protected void doThrowable(Throwable e)
                    throws Exception
Throws:
Exception

doFinally

protected void doFinally()
                  throws Exception
Throws:
Exception

postToUiThreadAndWait

protected void postToUiThreadAndWait(Callable c)
                              throws Exception
Posts the specified runnable to the UI thread using a handler, and waits for operation to finish. If there's an exception, it captures it and rethrows it.

Parameters:
c - the callable to post
Throws:
Exception - on error


Copyright © 2012. All Rights Reserved.