ActivityLifecycleOwner

class ActivityLifecycleOwner(targetActivity: Activity) : ActivityLifecycleCallbacksImpl, LifecycleOwner

将Activity(非ComponentActivity)转换,使其获取Lifecycle 利用ActivityLifecycleCallbacks 检测对应的生命周期,来自行实现 Lifecycle

Constructors

ActivityLifecycleOwner
Link copied to clipboard
fun ActivityLifecycleOwner(targetActivity: Activity)

Functions

equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
getLifecycle
Link copied to clipboard
open override fun getLifecycle(): Lifecycle
handleLifecycleEvent
Link copied to clipboard
private fun handleLifecycleEvent(activity: Activity, event: Lifecycle.Event)
hashCode
Link copied to clipboard
open fun hashCode(): Int
onActivityCreated
Link copied to clipboard
open override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?)
onActivityDestroyed
Link copied to clipboard
open override fun onActivityDestroyed(activity: Activity)
onActivityPaused
Link copied to clipboard
open override fun onActivityPaused(activity: Activity)
onActivityPostCreated
Link copied to clipboard
open fun onActivityPostCreated(p0: Activity, p1: Bundle?)
onActivityPostDestroyed
Link copied to clipboard
open fun onActivityPostDestroyed(p0: Activity)
onActivityPostPaused
Link copied to clipboard
open fun onActivityPostPaused(p0: Activity)
onActivityPostResumed
Link copied to clipboard
open fun onActivityPostResumed(p0: Activity)
onActivityPostSaveInstanceState
Link copied to clipboard
open fun onActivityPostSaveInstanceState(p0: Activity, p1: Bundle)
onActivityPostStarted
Link copied to clipboard
open fun onActivityPostStarted(p0: Activity)
onActivityPostStopped
Link copied to clipboard
open fun onActivityPostStopped(p0: Activity)
onActivityPreCreated
Link copied to clipboard
open fun onActivityPreCreated(p0: Activity, p1: Bundle?)
onActivityPreDestroyed
Link copied to clipboard
open fun onActivityPreDestroyed(p0: Activity)
onActivityPrePaused
Link copied to clipboard
open fun onActivityPrePaused(p0: Activity)
onActivityPreResumed
Link copied to clipboard
open fun onActivityPreResumed(p0: Activity)
onActivityPreSaveInstanceState
Link copied to clipboard
open fun onActivityPreSaveInstanceState(p0: Activity, p1: Bundle)
onActivityPreStarted
Link copied to clipboard
open fun onActivityPreStarted(p0: Activity)
onActivityPreStopped
Link copied to clipboard
open fun onActivityPreStopped(p0: Activity)
onActivityResumed
Link copied to clipboard
open override fun onActivityResumed(activity: Activity)
onActivitySaveInstanceState
Link copied to clipboard
open override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle)
onActivityStarted
Link copied to clipboard
open override fun onActivityStarted(activity: Activity)
onActivityStopped
Link copied to clipboard
open override fun onActivityStopped(activity: Activity)
toString
Link copied to clipboard
open fun toString(): String

Properties

lifecycleRegistry
Link copied to clipboard
private val lifecycleRegistry: LifecycleRegistry
targetActivity
Link copied to clipboard
private val targetActivity: Activity