Kotlin coruntines wont execute when in a launch and callback

I thought I was familiar enough with Kotlin’s coroutines, until I got this code. 1 to 8 are all printed except 2: import kotlinx.coroutines.* import java.lang.Runnable import java.lang.Thread.sleep import kotlin.concurrent.thread fun main() { runBlocking { Client.createAccount() delay(1000) } } object Client: CoroutineScope { override val coroutineContext = newSingleThreadContext(“Client”) fun createAccount() = launch { Client2.init(Runnable {…

Details

Save the login session on android WebView

public class MainActivity extends Activity { public WebView webView; private ProgressBar spinner; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.activity_main); webView = findViewById(R.id.webView); spinner = findViewById(R.id.progressBar); WebSettings websettings = webView.getSettings(); websettings.setJavaScriptEnabled(true); websettings.setDatabaseEnabled(true); String path = getApplicationContext().getDir(“cache”, Context.MODE_PRIVATE).getPath(); websettings.setDatabasePath(path); websettings.setDomStorageEnabled(true); websettings.setCacheMode(WebSettings.LOAD_DEFAULT); websettings.setUseWideViewPort(true); websettings.setLoadWithOverviewMode(true); websettings.setSupportZoom(true); websettings.setBuiltInZoomControls(true); websettings.setDisplayZoomControls(false); websettings.setAppCacheEnabled(true); webView.requestFocus(); //load webview webView.loadUrl(“https://facebook.com”); webView.setWebViewClient(new CustomViewClient()); hideNavigation(); }…

Details