HandlerGuard

object HandlerGuard

处理Handler与生命周期载体的解绑关系

Functions

equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
open fun hashCode(): Int
toString
Link copied to clipboard
open fun toString(): String
watch
Link copied to clipboard
fun watch(activity: Activity?, runnable: Runnable?, handler: Handler? = mainThreadHandler)
监控并处理handler的runnable 当activity销毁的时候,从handler中移除runnable待执行任务
fun watch(fragment: Fragment?, runnable: Runnable?, handler: Handler? = mainThreadHandler)
监控并处理 handler 的 runnable 当 Fragment 销毁的时候,从 handler 中移除 runnable 待执行任务