I am currently developing an android application for my project.
My project aim to have a multiple countdown timer(not more than 50) running on a background using a Handler post delayed
.
On every seconds, I have to query into my table to fecth and update some specific column.
my query is wrap with a try catch
and I am closing the Database at finally
.
This approach is working properly with a single thread, but once it become more than one threads,
it gives me an error something like the database is already close but morethan one thread is trying to access it
.
So I came up with idea to not close the database unless the whole application is closed.
So my question is, should I do what I am thinking? or there is a better approach for this?