Skip to content Skip to sidebar Skip to footer

Passing A Activity Context Into A Static Method, Memory Leak Potential?

I've seen this particular technique for launching activities and it seems to me like a bad idea because of static contexts but I was hoping someone might have a legit reason behind

Solution 1:

Passing something into a static function isn't a potential memory leak. Storing a variable in a static variable is. This technique is perfectly safe. Its one I'd even recommend, as you can pass in variables to the function and store them in extras inside the class that is going to use those extras, reducing the number of places that need to know of their existence and how they're laid out


Post a Comment for "Passing A Activity Context Into A Static Method, Memory Leak Potential?"