Class DynamicHandler<P,R>
- java.lang.Object
-
- android.os.Handler
-
- com.pranavpandey.android.dynamic.util.concurrent.DynamicHandler<P,R>
-
- Type Parameters:
P- The type of the progress.R- The type of the result.
public class DynamicHandler<P,R> extends android.os.HandlerAHandlerto handle updates from theDynamicTask.
-
-
Field Summary
Fields Modifier and Type Field Description static intMESSAGE_NULL_IF_NOTMessage constant to set the content tonullif not matched the criteria.static intMESSAGE_POST_PROGRESSMessage constant to publish the progress on the main thread.static intMESSAGE_POST_RESULTMessage constant to post the final result on the main thread.
-
Constructor Summary
Constructors Constructor Description DynamicHandler(android.os.Looper looper, DynamicRunnable<?,P,R> runnable)Constructor to initialize an object of this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DynamicRunnable<?,P,R>getRunnable()Returns the runnable handled by this handler.voidhandleMessage(android.os.Message msg)-
Methods inherited from class android.os.Handler
createAsync, createAsync, dispatchMessage, dump, getLooper, getMessageName, hasCallbacks, hasMessages, hasMessages, obtainMessage, obtainMessage, obtainMessage, obtainMessage, obtainMessage, post, postAtFrontOfQueue, postAtTime, postAtTime, postDelayed, postDelayed, removeCallbacks, removeCallbacks, removeCallbacksAndMessages, removeMessages, removeMessages, sendEmptyMessage, sendEmptyMessageAtTime, sendEmptyMessageDelayed, sendMessage, sendMessageAtFrontOfQueue, sendMessageAtTime, sendMessageDelayed, toString
-
-
-
-
Field Detail
-
MESSAGE_POST_RESULT
public static final int MESSAGE_POST_RESULT
Message constant to post the final result on the main thread.- See Also:
- Constant Field Values
-
MESSAGE_POST_PROGRESS
public static final int MESSAGE_POST_PROGRESS
Message constant to publish the progress on the main thread.- See Also:
- Constant Field Values
-
MESSAGE_NULL_IF_NOT
public static final int MESSAGE_NULL_IF_NOT
Message constant to set the content tonullif not matched the criteria.- See Also:
ImageViewHandler,TextViewHandler, Constant Field Values
-
-
Constructor Detail
-
DynamicHandler
public DynamicHandler(@NonNull android.os.Looper looper, @NonNull DynamicRunnable<?,P,R> runnable)Constructor to initialize an object of this class.- Parameters:
looper- The looper to be used.runnable- The runnable to receive the callbacks.- See Also:
DynamicRunnable.finish(DynamicResult),DynamicRunnable.onProgressUpdate(DynamicResult)
-
-
Method Detail
-
handleMessage
public void handleMessage(@NonNull android.os.Message msg)- Overrides:
handleMessagein classandroid.os.Handler
-
getRunnable
@Nullable public DynamicRunnable<?,P,R> getRunnable()
Returns the runnable handled by this handler.- Returns:
- The runnable handled by this handler.
-
-