sqlite - Closing open db connections opened by content providers in android -


i have scenario in same runtime of app, of local databases deleted , recreated new encryption. edge case possible.

the problem is, system maintains open connections these databases because accessed via content providers, @ least understanding. when attempt create / write new databases in same runtime after old ones deleted, receive crash saying databases read-only. if kill app , reopen fine.

i attempted kill app manually using finishaffinity() doesn't kill app @ least enough system clean database connections.

is there way can force system close open connections databases?

if using database , open connection in read mode not able update or add data in database. have close database opened uing

 db.close(); 

at end.


Comments