Skip to content

Commit

Permalink
Step 5, adding the MainThreadExecutor class.
Browse files Browse the repository at this point in the history
  • Loading branch information
legalimpurity committed Jul 14, 2018
1 parent 357fa6d commit 7604dcf
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.legalimpurity.asynctaskwrittenfromscratch.MyAsyncTaskCode.executors

import android.os.Looper
import java.util.concurrent.Executor

class MainThreadExecutor : Executor
{
private val handler = android.os.Handler(Looper.getMainLooper())

override fun execute(runnable: Runnable?) {
handler.post(runnable)
}
}

0 comments on commit 7604dcf

Please sign in to comment.