hey, how do you usually handle situations, when yo...
# android
m
hey, how do you usually handle situations, when you need to store for example
Context
var/val in your class and in the end you want to clean it/set to null to prevent memory leaks?
var Context?
,
WeakReference<Context>
?
stackoverflow 1
l
@mnawrot I always use application context when possible. I made a small lib to have
appCtx
everywhere in Kotlin for my own use and for others to benefit: https://github.com/LouisCAD/Splitties#app-context