I have AsyncTask that processes some background HTTP stuff. AsyncTask runs on schedule (Alarms/service) and sometime user executes it manually.
I process records fro
You can execute your AsyncTask's on an Executor
using executeOnExecutor()
To make sure that the threads are running in a serial fashion please use: SERIAL_EXECUTOR
.
Misc: How to use an Executor
If several activities are accessing your DB why don't create a sort of gateway database helper and use the synchronized
block to ensure only one thread has access to it at an instant