Kotlin下Could not find Fragment constructor

以下下两种方法都可以解决


class ReflectDemoFragment @JvmOverloads constructor() :Fragment(){


}
class ReflectDemoFragment () :Fragment(){

    companion object {
        @JvmStatic
        val fragment = ReflectDemoFragment()
    }

}

你可能感兴趣的:(Kotlin下Could not find Fragment constructor)