Hi, I'm trying to find some simple way of queueing tasks on a thread that is NOT the UI-thread.
I have a BroadcastReceiver that responds to Intents each time an image is taken, and notifies my Service each time that happens. The Service will have to do some processing (scaling and rotating an image) and I would like to do this on a new thread (The service is running on the same thread as my main Activity). So I've been looking at AsyncTask for that.
My problem is that if the next image is taken BEFORE the previous has been fully processed, I will have two AsyncTasks running simultaneously, and I don't want that. I would like to queue the processing of the next one until the first one is done.
So basically I want two threads. One is the standard UI-thread, and another one that is my worker thread where i can have a queue of task to perform.
What would be the best approach?