[英]Unity: Call Android Kotlin Function Inside Companion Object from Unity
[英]Call another function or variable inside a companion object android kotlin from main thread
请帮助在kotin android主要活动的同伴之外呼叫另一个function
class MainActivity{
val name = "stackoverflow"
companion object(){
//call the both the name and showDialog from this main thread
}
fun showDialog(){
Dialog.show()
}
}
我假设您想在 MainActivity 中显示对话框。 让我们说其他片段,或者可能来自 MainActivity 本身。
最好的方法:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.