Skip to content

Commit

Permalink
# implemented better activity context handling -> resolves issue caus…
Browse files Browse the repository at this point in the history
…ing by deeplinks
  • Loading branch information
sbra0902 committed Feb 2, 2021
1 parent 3d6b09e commit 8a34173
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ class ActivityContextGuard(applicationContext: Application) : LifecycleObserver
private var currentRef: WeakReference<ComponentActivity> = WeakReference(activity)

init {
activity.lifecycle.addObserver(this)
if(activity.lifecycle.currentState != Lifecycle.State.DESTROYED){
activity.lifecycle.addObserver(this)
map[reference] = this
}else{
currentRef.clear()
}
}

Expand Down

0 comments on commit 8a34173

Please sign in to comment.