private volatile ArrayList<StrokeQueueEntry> queue;
public void run() {
//Process items in the queue
if(queue.size()>0){
while(queue.size()>0){
//Lots of code here basically to process & remove the first element in the list
Thread.yield();
}
}
Thread.yield();
}
What I am wondering is if this is the best way to do it? I am not an expert with Java or concurrency yet,
Sorry for the multipost, I pressed enter by accident and I cannot edit my post, but this is being used so the UI thread in my android app wont hang. If anyone knows a better way of doing this I would love to hear it. As far as i know the thread is doing its job and the UI thread isnt hanging, but I am not very confident if this is how I am supposed to do it?

New Topic/Question
Reply



MultiQuote





|