How to create serial queue in Android?
<p>In iOS I can create GCD serial queue like this: </p>

<pre><code>let serialQueue = DispatchQueue(label: "serialQueue")
</code></pre>

<p>Blocks are executed in a FIFO order, one block at a time. How can I do it in Android?</p>

<p>This is how chunk of code can be performed on the queue:</p>

<pre><code>serialQueue.async {
</code></pre>

<p>As I <a href="https://developer.android.com/reference/android/os/AsyncTask.html" rel="nofollow">see</a> <code>AsyncTask</code> is serial: "Starting with HONEYCOMB, tasks are executed on a single thread to avoid common application errors caused by parallel execution."</p>

<p>I guess t is FIFO, the execution.</p>

<p>Found <a href="http://winterbe.com/posts/2015/04/07/java8-concurrency-tutorial-thread-executor-examples/" rel="nofollow">this</a> JAVA 8 concurrency tutorial.</p>