android-beans / rocks.frieler.android.beans.scopes.activity / ActivityAware / setActivity

setActivity

abstract fun setActivity(activity: Activity?): Unit

Sets the Activity, the bean is scoped to.

The Activity is set again when the same bean is obtained for a new Activity, e.g. after a configuration-change. At the end of the Activity's lifecycle, this method is called with null to clear any references to the Activity and prevent memory-leaks.

Parameters

activity - the Activity, the bean is scoped to