質問編集履歴
1
自分なりに考えた方法を追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -67,3 +67,33 @@
|
|
67
67
|
|
68
68
|
|
69
69
|
よろしくお願いします。
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
追記:こういう感じですかね・・・?
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
```kotlin
|
78
|
+
|
79
|
+
class API {
|
80
|
+
|
81
|
+
val handler = Handler(Looper.getMainLooper())
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
public fun fetchUserName(func: (String) -> Unit) {
|
86
|
+
|
87
|
+
thread {
|
88
|
+
|
89
|
+
Thread.sleep(5000L)
|
90
|
+
|
91
|
+
handler.post{func("hogehoge")}
|
92
|
+
|
93
|
+
}
|
94
|
+
|
95
|
+
}
|
96
|
+
|
97
|
+
}
|
98
|
+
|
99
|
+
```
|