我不知道出于什么原因,我在构建项目时得到未解析的参考:参数。无法理解我做错了什么?有人能指出我哪里出错了?我正在使用支持片段android.support.v4.app.Fragment;
public class Tab1() : Fragment() {
val TAG = "Tab1";
companion object {
public fun create(uuid: String): Tab1 {
val history:Tab1 = Tab1()
history.arguments.putString("uuid",uuid)
return history
}
}
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup, savedInstanceState: Bundle?): View {
val view = inflater.inflate(R.layout.tab1, container, false)
return view
}
}
答案 0 :(得分:1)
是的!我通过以下实现解决了这个问题。感谢。
companion object Factory {
public fun newInstance(uuid: String): Tab1 {
val history:Tab1 = Tab1()
val args = Bundle()
args.putString("uuid",uuid)
history.setArguments(args)
return history
}
}