从对象ArrayList获取项目

时间:2019-01-29 15:37:22

标签: android arraylist kotlin

如何在OrganizationAccess中调用access_role?

这是课程

用户

class User : Serializable {
    var id = ""
    var user_organization_accesses: ArrayList<OrganizationAccess>? = null
}

组织访问权限

class OrganizationAccess:Serializable {

    var access_role = ""
}

我尝试过的

  mUser = intent.getSerializableExtra(ARG_PARAM) as User // receive from previous activity
  longToast("Role is " + mUser.user_organization_accesses!!.xxx)

我应该为xxx写什么?

1 个答案:

答案 0 :(得分:2)

我已经解决了

 longToast("Role is " + mUser.user_organization_accesses!!.component1().access_role)