I have a database in my app and when I need to insert or delete something I have to open the database,of course. I do this every activity, so that means that I open the database even if it is open. In DDMS I get :”Leak found”. What should I do to open my database only once time? Should I use a singleton class?
Share
Yes, Singleton is the best option. You can use a common instance to access the database.
If you want to share DB with external activities, then go for content provider.