com.github.ignition.core.tasks
Interface IgnitedAsyncTaskHandler<ContextT extends android.content.Context,ProgressT,ReturnT>

Type Parameters:
ContextT -
ProgressT -
ReturnT -
All Known Implementing Classes:
IgnitedAsyncTask, IgnitedAsyncTaskDefaultHandler

public interface IgnitedAsyncTaskHandler<ContextT extends android.content.Context,ProgressT,ReturnT>

To be implemented by classes that whish to receive callbacks about task status and progress updates. Note that if this class is a Context, you can use the simpler IgnitedAsyncTaskContextHandler instead.

It's best to not implement this interface yourself, but instead inherit from IgnitedAsyncTaskDefaultHandler, since it already handles the context reference for you. In any case, take extreme caution to not keep a strong reference to any Context in your implementation, since otherwise it will leak during Activity configuration changes! This includes keeping strong references to Views and any other framework classes that bind to the current context.

Author:
Matthias Kaeppler

Method Summary
 ContextT getContext()
           
 boolean onTaskCompleted(ContextT context, ReturnT result)
          Return true from this method if you want to swallow the event; it will then not be passed on to the task itself.
 boolean onTaskFailed(ContextT context, Exception error)
          Return true from this method if you want to swallow the event; it will then not be passed on to the task itself.
 boolean onTaskProgress(ContextT context, ProgressT... progress)
          Return true from this method if you want to swallow the event; it will then not be passed on to the task itself.
 boolean onTaskStarted(ContextT context)
          Return true from this method if you want to swallow the event; it will then not be passed on to the task itself.
 boolean onTaskSuccess(ContextT context, ReturnT result)
          Return true from this method if you want to swallow the event; it will then not be passed on to the task itself.
 void setContext(ContextT context)
           
 

Method Detail

getContext

ContextT getContext()

setContext

void setContext(ContextT context)

onTaskStarted

boolean onTaskStarted(ContextT context)
Return true from this method if you want to swallow the event; it will then not be passed on to the task itself.


onTaskProgress

boolean onTaskProgress(ContextT context,
                       ProgressT... progress)
Return true from this method if you want to swallow the event; it will then not be passed on to the task itself.


onTaskCompleted

boolean onTaskCompleted(ContextT context,
                        ReturnT result)
Return true from this method if you want to swallow the event; it will then not be passed on to the task itself.


onTaskSuccess

boolean onTaskSuccess(ContextT context,
                      ReturnT result)
Return true from this method if you want to swallow the event; it will then not be passed on to the task itself.


onTaskFailed

boolean onTaskFailed(ContextT context,
                     Exception error)
Return true from this method if you want to swallow the event; it will then not be passed on to the task itself.



Copyright © 2012. All Rights Reserved.