I want to create a Singleton class that will be available to all points of my application. The problem is that this class will need context for its operations.
I donβt need to recreate a singleton in every action because it loses all meaning, so I thought about creating it in my MainActivity, using the init method, in which I pass the context as an argument. From now on, my singleton will be useful, but I think this is a bad design, because my MainActivity link will always be kept, and therefore I may run into memory leaks.
I'm here?
Michelreap
source share