android - 意图不使用片段与伴随对象一起工作
问题描述
Intent 参数中存在错误,无法弄清楚如何解决此问题。
companion object {
fun start(context: BookingFragment) {
context.startActivity(Intent(context, BookingFragment::class.java))
}
//错误:
None of the following functions can be called with the arguments supplied:
public constructor Intent(p0: Context!, p1: Class<*>!) defined in android.content.Intent
public constructor Intent(p0: String!, p1: Uri!) defined in android.content.Intent