Commit 6b5de438 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

uiStart() for coroutines UI context fine dispatch

parent 3e06e580
......@@ -2,8 +2,10 @@ package org.videolan.vlc.util
import android.arch.lifecycle.ViewModel
import android.arch.lifecycle.ViewModelProviders
import android.os.Looper
import android.support.v4.app.Fragment
import android.support.v4.app.FragmentActivity
import kotlinx.coroutines.experimental.CoroutineStart
import kotlinx.coroutines.experimental.delay
import java.io.File
import java.net.URI
......@@ -43,4 +45,6 @@ suspend fun retry (
delay(delayTime)
}
return block() // last attempt
}
\ No newline at end of file
}
fun uiStart() = if (Looper.getMainLooper() == Looper.myLooper()) CoroutineStart.UNDISPATCHED else CoroutineStart.DEFAULT
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment