hierarchy can touch its views. at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:7900) at android.view.ViewRootImpl.requestLayout(ViewRootImpl.java:1170) at android.view.View.requestLayout(View.java:20043) at android.view.View.requestLayout(View.java:20043) at android.view.View.requestLayout(View.java:20043) at android.view.View.requestLayout(View.java:20043) at android.view.View.requestLayout(View.java:20043) at android.view.View.requestLayout(View.java:20043) at android.view.View.requestLayout(View.java:20043) at android.widget.TextView.checkForRelayout(TextView.java:8024) at android.widget.TextView.setText(TextView.java:4959) at android.widget.TextView.setText(TextView.java:4786) at android.widget.TextView.append(TextView.java:4451) at android.widget.TextView.append(TextView.java:4441) メインスレッド以外から View などの画面更新をしようとした場合に発生する例外
java.net.InetAddress.getAllByNameImpl(InetAddress.java:242) at java.net.InetAddress.getAllByName(InetAddress.java:220) at libcore.net.http.HttpConnection.<init>(HttpConnection.java:71) at libcore.net.http.HttpConnection.<init>(HttpConnection.java:50) at libcore.net.http.HttpConnection.connect(HttpConnection.java:351) … at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) at dalvik.system.NativeStart.main(Native Method) メインスレッドから http request をしようとした場合に発生する例外
= async { "Hello, " } val world = async { "World" } print(hello.await() + world.await()) } println(" from Droidkaigi ") } A: Hello, World from Droidkaigi B: from Droidkaigi Hello, World C: from Droidkaigi
= async { "Hello, " } val world = async { "World" } print(hello.await() + world.await()) } println(" from Droidkaigi ") } A: Hello, World from Droidkaigi B: from Droidkaigi Hello, World C: from Droidkaigi
= async { "Hello, " } val world = async { "World" } print(hello.await() + world.await()) } println(" from Droidkaigi ") } A: Hello, World from Droidkaigi B: from Droidkaigi Hello, World C: from Droidkaigi
by MainScope() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) launch { // do something } } override fun onDestroy(){...} }
public actual object Dispatchers { @JvmStatic public actual val Default: CoroutineDispatcher = createDefaultDispatcher() @JvmStatic public actual val Main: MainCoroutineDispatcher get() = MainDispatcherLoader.dispatcher @JvmStatic public actual val Unconfined: CoroutineDispatcher = kotlinx.coroutines.Unconfined @JvmStatic public val IO: CoroutineDispatcher = DefaultScheduler.IO }