How to check “instanceof ” class in kotlin?

后端 未结 8 1579
有刺的猬
有刺的猬 2020-12-14 05:14

In kotlin class, I have method parameter as object (See kotlin doc here ) for class type T. As object I am passing different classes when I am calling metho

8条回答
  •  天命终不由人
    2020-12-14 05:40

    Other solution : KOTLIN

    val fragment = supportFragmentManager.findFragmentById(R.id.fragment_container)
    
    if (fragment?.tag == "MyFragment")
    {}
    

提交回复
热议问题