Please help call another function outside the companion in kotin android main activity
class MainActivity{
val name = "stackoverflow"
companion object(){
//call the both the name and showDialog from this main thread
}
fun showDialog(){
Dialog.show()
}
}
I assume you want to showDialog in MainActivity. let's say other fragments or maybe from MainActivity itself.
Best approaches from this:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.