用于发送数据:
val u = Users()
val b = Bundle()
b.putStringArrayList("name01", name01)
u.arguments=b
用于接收数据:
override fun onCreateView(inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?): View? {
strtext = arguments!!.getStringArrayList("name01")
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_users, container, false)
}
输出:kotlin.KotlinNullPointerException
我应该如何获取数据? 还有另一种方法吗?