Please help call another function outside the companion in Kotlin 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 :