Eric Novins
Eric Novins

Reputation: 431

ViewPager with Database access in every fragment and how to avoid close() errors

Are DB close errors dangerous? I have a viewpager with 3 fragments that all access the DB. But I get an error about closing the DB everytime. How am I supposed to control this if all 3 fragments need the DB at the same time?

Upvotes: 1

Views: 998

Answers (1)

user468311
user468311

Reputation:

You should control db connections of all your components. Consider keeping one DB connection for entire Fragment Activity, which contains your viewpager. Erros can cause db connection failure.

Upvotes: 1

Related Questions